zoukankan      html  css  js  c++  java
  • selenium 您的连接不是私密连接的解决办法

     
     
     
     

    一、问题描述

      用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()

      

      

    Only action can relieve the uneasiness.
  • 相关阅读:
    python时间类型相关
    python调用函数
    LightGBM
    保存训练好的模型并调用
    Bootstrap Table
    Jquery 获取元素上绑定的事件
    C# DLL 反编译改代码
    FastReport C# 导出
    Log4Net
    BootStrap Table
  • 原文地址:https://www.cnblogs.com/liangmingshen/p/14676706.html
Copyright © 2011-2022 走看看