如何禁用Firefox的不受信任的连接警告使用Selenium? [英] How to disable Firefox's untrusted connection warning using Selenium?

查看:1435
本文介绍了如何禁用Firefox的不受信任的连接警告使用Selenium?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试找到一种方法来禁止Firefox在每次连接使用不受信任证书时使用Selenium发出警告。我相信,最好的解决方案是设置浏览器的偏好。

Trying to find a way to disable Firefox from raising a warning every time a connection uses an "untrusted" certificate, with Selenium. I believe that the kind of solution that would work the best would be to set one of the browser preferences.

非常感谢!

推荐答案

我发现此评论在Selenium for Java中启用此功能。还有此StackOverflow问题关于同样的问题,也为Java 对于Python,这是我的我想出了这个,通过浏览 FirefoxProfile 代码:

I found this comment on enabling this functionality in Selenium for Java. There is also this StackOverflow question about the same issue, also for Java For Python, which was my desired target language, I came up with this, through browsing the FirefoxProfile code:

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True

只要我已经测试,已经产生了预期的行为。

Which, as far as I have tested, has produced the expected behavior.

希望这有助于某人!

这篇关于如何禁用Firefox的不受信任的连接警告使用Selenium?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆