accept ssl cert with marionette firefox webdrive python splinter(接受带有 marionette firefox webdrive python splinter 的 ssl 证书)
问题描述
当使用 python splinter firefox 47 marionette new webdriver 时,访问我想要的网站时出现证书错误,我尝试使用
when using python splinter firefox 47 marionette new webdriver, it gives certificate error when access the website i want, i tried to accept ssl certs with
browser = Browser('firefox', capabilities = {'marionette': True, 'acceptSslCerts': True})
browser = Browser('firefox', capabilities = {'marionette': True, 'acceptSslCerts': True})
或者使用trustAllSSLCertificates而不是acceptSslCerts,但仍然给我证书错误,是什么问题?
or using trustAllSSLCertificates instead of acceptSslCerts, but still gives me certificate error, what is the problem?
推荐答案
Firefox bug 现已解决:https://github.com/mozilla/geckodriver/issues/93
The Firefox bug is now resolved: https://github.com/mozilla/geckodriver/issues/93
现在,如果您想立即使用此功能,您需要安装最新的 Firefox Nightly 版本(52 或 53):https://nightly.mozilla.org/
For now, you need to install the latest Firefox Nightly build (52 or 53) if you want to use this feature right away: https://nightly.mozilla.org/
然后,下面的代码就可以工作了(Python selenium 只在这里,但我猜你可以在你的代码中用最新的:acceptInsecureCerts"替换acceptSslCerts")
Then, the following code will work (Python selenium only here, but my guess is that you can replace "acceptSslCerts" with the latest: "acceptInsecureCerts" in your code)
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
caps = DesiredCapabilities.FIREFOX.copy()
caps['acceptInsecureCerts'] = True
ff_binary = FirefoxBinary("path to the Nightly binary")
driver = webdriver.Firefox(firefox_binary=ff_binary, capabilities=caps)
driver.get("https://expired.badssl.com")
我不确定如何将 Nightly 二进制文件传递给 Splinter - https://github.com/cobrateam/splinter/pull/437 - 希望标准版 Firefox 将于 2017-03-06 交付https://wiki.mozilla.org/RapidRelease/Calendar
edit: I am not sure how to pass the Nightly binary to Splinter though - https://github.com/cobrateam/splinter/pull/437 - hopefully the standard version of Firefox will be delivered on 2017-03-06 https://wiki.mozilla.org/RapidRelease/Calendar
这篇关于接受带有 marionette firefox webdrive python splinter 的 ssl 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:接受带有 marionette firefox webdrive python splinter 的 ssl 证书


- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01