环境:ubuntu14.04,python2.7, selenium3.0.1, Google Chrome 52.0.2743.116(64-bit)
在学习selenium时拷贝别人的代码执行报错,原因应该在这一句:driver = webdriver.Chrome()
在打开的chrome窗口中显示错误:You are using an unsupported command-line flag --ignore-certificate-errors. Stability and security will suffer
解决办法:
忽略掉错误,driver部分改为:
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
options = webdriver.ChromeOptions()
options.add_argument("--test-type")
# 初始化一个webdriver
driver = webdriver.Chrome(chrome_options=options)
恩,改了之后,虽然原来的功能还没完成,但是确实没有提示错误了