【发布时间】:2016-11-30 00:58:49
【问题描述】:
我试图强制 selenium 忽略 SSL 错误,但无法弄清楚。见过acceptSslCerts的能力,但是在使用firefox的时候好像没有任何效果
【问题讨论】:
标签: python selenium firefox automation
我试图强制 selenium 忽略 SSL 错误,但无法弄清楚。见过acceptSslCerts的能力,但是在使用firefox的时候好像没有任何效果
【问题讨论】:
标签: python selenium firefox automation
对于您的方案,您可以尝试类似的方法。它在 Firefox 浏览器上对我来说效果很好。
按照以下步骤创建新的 firefox 配置文件并在那里接受 SSL 证书。
现在使用新创建的 firefox 配置文件运行您的 selenium 测试。根据您的要求修改以下代码。
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
profile.assume_untrusted_cert_issuer=True
driver = webdriver.Firefox(firefox_profile='C:/NewFirefoxProfile)
driver.get('https://cacert.org/')
【讨论】: