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.
  • 相关阅读:
    Luogu P2016 战略游戏(树形DP)
    Luogu P2486 染色(树链剖分+线段树)
    Luogu P3178 树上操作(树链剖分+线段树)
    Luogu P2590 树的统计(树链剖分+线段树)
    Luogu P2146 软件包管理器(树链剖分+线段树)
    获得spring
    网卡绑定多个ip
    描述01-配置文件咋整
    进程查看
    端口查看,进程杀死
  • 原文地址:https://www.cnblogs.com/liangmingshen/p/14676706.html
Copyright © 2011-2022 走看看