我是编程的新手,Python大约2个月前开始使用Python文本,正在浏览Sweigart的自动化无聊的东西.我正在使用IDLE并且已经安装了selenium模块和Firefox浏览器.每当我尝试运行webdriver函数时,我都会得到:
from selenium import webdriver
browser = webdriver.Firefox()
Run Code Online (Sandbox Code Playgroud)
例外: -
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000249C0DA1080>>
Traceback (most recent call last):
File "C:\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__
self.stop()
File "C:\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000249C0E08128>>
Traceback (most recent call last):
File "C:\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__
self.stop()
File …Run Code Online (Sandbox Code Playgroud) 我有700多个链接要检查,它们是来自网站的长链接.它们是受信任的,但FireFox不会将它们视为可信任的.那么如何禁用"此连接不受信任"或快速添加大量链接?
我在Java中使用Web驱动程序处理UntrustedSSLcertificates时遇到困难.
我创建了firefox配置文件:
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
Run Code Online (Sandbox Code Playgroud)
我创建了firefox配置文件,添加了覆盖证书.
这不是处理SSL证书.
有没有其他方法来处理UntrustedSSLcertificates?
元:-
重现步骤 :-
WebDriver driver = new FirefoxDriver();
driver.get("untrusted/self-signed URL")
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪 :-
org.openqa.selenium.WebDriverException:到达错误页面:about:certerror?e=nssBadCert&u=xxxxxxxx&c=UTF-8&f=regular&d=xxxxxx%20uses%20an%20invalid%20security%20certificate.%0A%0AThe%20certificate%20is%20not %20受信任%20,因为%20it%20是%20自签名的。%0A%20证书%20是%20不是%20对于%20%20名称%20xxxxxx%0A%0AError%20code%3A%20%3Ca%20id%3D%22errorCode%有效%20 22%20title%3D%22SEC_ERROR_UNKNOWN_ISSUER%22%3ESEC_ERROR_UNKNOWN_ISSUER%3C/a%3E%0A 构建信息:版本:'3.0.1',修订版:'1969d75',时间:'2016-10-18 09:48:19 - 0700'系统信息:主机:'Saurabh-PC',ip:'192.168.3.8',os.name:'Windows 10',os.arch:'x86',os.version:'10.0',java.version: “1.8.0_71”驱动程序信息:org.openqa.selenium.firefox.FirefoxDriver
截屏 :-
我也尝试过使用FirefoxProfileas :-
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
dc.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver driver = new FirefoxDriver(dc);
driver.get("untrusted/self-signed URL");
Run Code Online (Sandbox Code Playgroud)
但问题和上面是一样的。
已尝试过的参考链接:-
根据此错误,已通过错误 1103196添加了对不受信任/自签名证书的支持,并将从Firefox 52 …
我正在使用Selenium + C#编写测试,但我面临一个重要问题,因为我在使用安全连接 ( HTTPS )测试我的网站时没有找到解决方案。我在 stackoverflow 上找到的所有解决方案都已过时或不起作用。我尝试使用以下问题中的所有解决方案: Selenium 为什么将 Firefox 驱动程序的 acceptuntrustedcertificates 设置为 true 不起作用?
但是他们没有帮我解决问题也不是使用Nightly FireFox的解决方案。尽管如此,当 selenium 加载 Firfox 浏览器时,我看到页面:“您的连接不安全”。
配置:
我的代码是:
FirefoxOptions options = new FirefoxOptions();
FirefoxProfile profile = new FirefoxProfile();
profile.AcceptUntrustedCertificates = true;
profile.AssumeUntrustedCertificateIssuer = false;
options.Profile = profile;
driver = new FirefoxDriver(FirefoxDriverService.CreateDefaultService() , options , TimeSpan.FromSeconds(5));
Drivers.Add(Browsers.Firefox.ToString() , driver);
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助!
更新我的问题在这里:
注 1:致任何将我的问题标记为与此问题重复的人:
Firefox selenium webdriver 给出了“不安全的连接” 我认为这是同样的问题,但我需要 C# 的解决方案,我尝试将您的 JAVA 代码与我上面的代码相匹配
首先,我将以下语句改为 TRUE:
profile.AssumeUntrustedCertificateIssuer = …Run Code Online (Sandbox Code Playgroud) 当使用python splinter firefox 47 marionette new webdriver时,它在访问我想要的网站时出现证书错误,我试图接受ssl证书与
browser = Browser('firefox',capabilities = {'marionette':True,'acceptSslCerts':True})
或使用trustAllSSLCertificates而不是acceptSslCerts,但仍然给我证书错误,有什么问题?