原因:证书错误
解决方法:
忽略错误直接进入
Chrome:
options.add_argument(‘ignore-certificate-errors’)
'''
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('ignore-certificate-errors')
driver = webdriver.Chrome(chrome_options=options)
driver.get('https://192.168.100.1')
driver.close()
'''
Firefox:
profile.accept_untrusted_certs = True
'''from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
driver.get('https://192.168.100.1')
driver.close()
'''
IE:
capabilities[‘acceptSslCerts’] = True
'''from selenium import webdriver
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)
driver.get('https://192.168.100.1')
driver.close()
'''