【问题标题】:You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer您正在使用不受支持的命令行标志:--ignore-certificate-errors。稳定性和安全性将受到影响
【发布时间】:2014-06-27 00:29:22
【问题描述】:

加载 chromedriver 时,我在多个 Selenium Python 项目中收到此错误。它们都从这些导入开始,以防特定的硒库......

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

最近我升级到 Python selenium 包 2.42.1,不确定它是特定于这些更新还是 chromedriver 的东西?有没有其他人看到过这个,是否有任何文档,如果有的话是什么潜在的问题。

我在 Windows 7 和 Windows 8 操作系统上发现了这个。

【问题讨论】:

    标签: python google-chrome selenium selenium-webdriver selenium-chromedriver


    【解决方案1】:

    ChromeDriver 问题跟踪器中提出了许多票证。

    这是主要的:

    Chrome starts with message "You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer."

    请密切关注最新进展。

    【讨论】:

      【解决方案2】:

      此问题已在 Chromedriver 2.11 中解决。升级应该就足够了:

      brew upgrade chromedriver

      但是,就我而言,我无法升级到最新的 Chromedriver 版本。相反,我不得不卸载然后重新安装 Chromedriver:

      brew install chromedriver brew uninstall chromedriver

      【讨论】:

      • 这显然只适用于Mac用户
      【解决方案3】:

      我在 chrome 驱动程序中运行 selenium 测试时遇到了这个问题。 我添加了

      <chrome.switches>test-type</chrome.switches>

      在 POM 文件中。

      如果你在命令行中运行,你可以添加

      -Dwebdriver.chrome.switches=--test-type
      

      在 Phyton 中,在实例化驱动程序时尝试这个

      desired_cap = DesiredCapabilities.CHROME
      desired_cap['chromeOptions'] = {}
      desired_cap['chromeOptions']['args'] = ['--test-type']
      

      【讨论】:

      • 用 Selenium 2.41.0 尝试过。尝试了<chrome.switches>test-type</chrome.switches><webdriver.chrome.switches>test-type</webdriver.chrome.switches>。在这两种情况下,我仍然看到来自 Chrome 的警告。你确定你没有其他事情发生吗?
      • @SiKing 你会在驱动实例化过程中分享日志吗?
      • 我不知道您所说的“驱动程序实例化期间的日志”是什么意思。我最终使用ChromeOptions() 让它工作,随后您必须将其传递给ChromeDriver() 构造函数,但我真的很想找到一个我不必传递给构造函数的解决方案。另外,我在互联网上找不到任何关于“webdriver.chrome.switches”的信息;你确定你的拼写正确吗?
      • @SiKing 我已经更新了我的答案。请检查一下
      • 正如我所说:ChromeOptions 方式工作得非常好。您的前两种方式:pom 和命令行 -D 开关不起作用,至少对我而言。
      猜你喜欢
      • 2017-09-14
      • 2015-11-09
      • 1970-01-01
      • 2017-06-28
      • 2012-12-22
      • 2014-08-01
      • 2018-08-11
      • 2014-09-12
      • 1970-01-01
      相关资源
      最近更新 更多