selenium2打开chrome时出现黄条(警告信息)去掉的方法

 java中

添加如下代码:

//avoid Chrome warnning message like "unsupported command-line flag --ignore-certificate-errors. "

ChromeOptions options = new ChromeOptions();

options.addArguments("--test-type");

WebDriver driver = new ChromeDriver(options);


python中

添加如下代码:

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/")

你可能感兴趣的:(selenium)