Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_certificate_errors的问题 #482

Open
alsk426 opened this issue Jan 1, 2025 · 2 comments
Open

ignore_certificate_errors的问题 #482

alsk426 opened this issue Jan 1, 2025 · 2 comments

Comments

@alsk426
Copy link

alsk426 commented Jan 1, 2025

浏览器设置co.ignore_certificate_errors()以后在打开一些http网站的时候打不开

举个例子,访问http://www.steelstrap.cn/
from DrissionPage import Chromium, ChromiumOptions

co = ChromiumOptions()
co.incognito() # 匿名模式
#co.headless() # 无头模式
co.set_argument('--no-sandbox') # 无沙盒模式
co.set_argument("--disable-gpu") # 禁用GPU提升加载速度
co.set_argument('--guest') # 设置访客模式
co.set_user_agent(
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36')
co.set_argument("--allow-running-insecure-content")
co.ignore_certificate_errors()

co.auto_port()

bwr = Chromium(co)

tab = bwr.latest_tab
tab.get('http://www.steelstrap.cn/')

设置了ignore_certificate_errors()以后被屏蔽
但是正常浏览器打开没问题,请问应该怎么设置?

@netfuns
Copy link

netfuns commented Jan 7, 2025

因为你这个站点就没有启用https,当然会出问题啊。
这个网站只发布了HTTP,不需要使用ignore_certificate_errors()

@alsk426
Copy link
Author

alsk426 commented Jan 9, 2025

因为你这个站点就没有启用https,当然会出问题啊。 这个网站只发布了HTTP,不需要使用ignore_certificate_errors()

那有没有兼容性高一点的写法呀?
如果不加这个选项,遇到有些证书有问题的站就会卡住

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants