1、chrome解决办法
在chromeoptions()中添加”--ignore-certificate-errors"为true的选项
#-*-coding: utf-8-*- from selenium import webdriver options = webdriver.ChromeOptions() #添加忽视证书错误选项 options.add_argument ('--ignore-certificate-errors') driver = webdriver.Chrome (chrome_options=options) driver.get ('URL')
2、firefox解决办法
在FirefoxProfile()中添加“accept_untrusted_certs"为true的选项
profile = webdriver. FirefoxProfile() # 添加接受不信任证书选项 profile.accept_untrusted_certs = True driver = webdriver.Firefox (firefox_profile=profile)
3、IE解决办法
通过javascript语句,忽略不信任证书的提示继续访问,点击转到此网页(不推荐)即可
#-*-coding: utf-8-*- from selenium import webdriver driver = webdriver.Ie() driver.get ( 'URL' ) #选择继续访问 URL js = "javascript: document.getElementById (' overridelink' ) .click() ;" driver.get (js) driver.execute_script (js)
标签:profile,webdriver,13,证书,Selenium,get,driver,错误处理,options From: https://www.cnblogs.com/ddupfan/p/17541457.html