Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported command-line flag: --ignore-certificate-errors

Using Python 2.7.5, python module selenium (2.41.0) and chromedriver (2.9).

When Chrome starts it displays a message in a yellow popup bar: "You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer." This simple example reproduces the problem.

from selenium import webdriver
browser = webdriver.Chrome()
browser.get("http://google.com/")

How do I remove this command-line flag in python selenium?

like image 236
Loknar Avatar asked Jun 11 '14 16:06

Loknar


2 Answers

This extra code removes the --ignore-certificate-errors command-line flag for me. In my opinion the arguments that can be added to webdriver.Chrome() could (and should) be better documented somewhere, I found this solution in a comment on the chromedriver issues page (see post #25).

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
browser = webdriver.Chrome(chrome_options=options)
browser.get("http://google.com/")
like image 125
Loknar Avatar answered Oct 05 '22 22:10

Loknar


This issue is resolved as of Chromedriver 2.11 (released Oct 2014). Updating will now do the trick.

like image 21
Shawn Erquhart Avatar answered Oct 06 '22 00:10

Shawn Erquhart