selenium 您的连接不是私密连接的解决办法

2023-05-03,,

 
 
 
 

一、问题描述

  用selenium启动浏览器时,chrome提示您的连接不是私密连接。

二、解决方案

方案1:

在当前页面用键盘输入  thisisunsafe  ,不是在地址栏输入,就直接敲键盘就行了,页面即会自动刷新进入网页,亲测有效。

但是有更简单的方法,见方案2。

方案2:

(2)设置忽略ssl证书认证的错误,或者接收不信任的认证

  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://cacert.org/') 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://cacert.org/') 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://cacert.org/') driver.close()

  

  

selenium 您的连接不是私密连接的解决办法的相关教程结束。

《selenium 您的连接不是私密连接的解决办法.doc》

下载本文的Word格式文档,以方便收藏与打印。