You get this error when the browser asks you to accept the certificate from a website. You can set to ignore these errors by default in order avoid these errors.
For Chrome, you need to add --ignore-certificate-errors and
--ignore-ssl-errors ChromeOptions() argument:
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
driver = webdriver.Chrome(chrome_options=options)
For the Firefox, you need to set accept_untrusted_certs FirefoxProfile() option to True:
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
For the Internet Explorer, you need to set acceptSslCerts desired capability:
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…