浏览器SSL提示
我们看一下IE的解决方案,对ie浏览器而言,需要添加Desired Capabilities的acceptSslCerts选项为True,代码如下: 的
112 / 166
#_*_ coding:utf-8 _*_
__author__ = '苦叶子'
from selenium import webdriver
if __name__ == '__main__':
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)
driver.get(u'https://cacert.org/')
print driver.title driver.quit()
对于firefox浏览器则需要添加FirefoxProfile()的accept_untrusted_certs的选项为True,示例代码如下:
#_*_ coding:utf-8 _*_
__author__ = '苦叶子'
from selenium import webdriver
if __name__ == '__main__':
profile=webdriver.FirefoxProfile()
profile.accept_untrusted_certs=True
driver=webdriver.Firefox(firefox_profile=profile)
113 / 166
driver.get(u'https://cacert.org/')
driver.close()
对于chrome浏览器则需要添加ChromeOptions()的--ignore-certificate-errors选项为True,示例代码如下:
#_*_ coding:utf-8 _*_
__author__ = '苦叶子'
from selenium import webdriver
if __name__ == '__main__':
options=webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') driver=webdriver.Chrome(chrome_options=options) driver.get(u'https://cacert.org/') driver.close()

  

python SSL处理的更多相关文章

  1. Python‘ssl.match_hostname()’函数SSL证书验证安全绕过漏洞

    漏洞名称: Python‘ssl.match_hostname()’函数SSL证书验证安全绕过漏洞 CNNVD编号: CNNVD-201312-033 发布时间: 2013-12-04 更新时间: 2 ...

  2. Python [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 解决方法

    一个搭建在SAE上的Django应用,使用新浪微博提供的Python SDK已经稳定运行一年有余,但最近开始持续出现微博认证失败的状况. 摘录微博python SDK的错误提示如下所示: ERROR: ...

  3. python SSL 错误

    python 使用pip 安装模块是提示SSL错误 出现该问题的原因由于系统的openssl是1.0.1的版本,对于python3.7太老了,需要更新为openssl1.0.2或者libressl2. ...

  4. MacOS升级到Monterey后python SSL握手失败问题

    MacOS升级到Monterey 12.0.1后,忽然发现原来工作正常的python3请求华为restconf API报错失败,提示 ssl.SSLError: [SSL: SSLV3_ALERT_H ...

  5. 2019-05-14 Python SSL

    解决SSL报错问题 -- 导库 import ssl import urllib.request context = ssl._create_unverified_context() --用urlli ...

  6. ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

    官方已经给出解决方案:https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension- ...

  7. Python爬虫连载7-cookie的保存与读取、SSL讲解

    一.cookie的保存与读取 1.cookie的保存-FileCookie.Jar from urllib import request,parse from http import cookieja ...

  8. python虚拟环境的使用

    一. 安装 sudo apt-get install python-virtualenv 二. 创建环境 sudo virtualenv Myenv 创建完全隔离的Python环境,实质是创建了一个文 ...

  9. python爬虫(五)_urllib2:Get请求和Post请求

    本篇将介绍urllib2的Get和Post方法,更多内容请参考:python学习指南 urllib2默认只支持HTTP/HTTPS的GET和POST方法 urllib.urlencode() urll ...

随机推荐

  1. 解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 问题

    通过这里的回答,我们可以知道: Tomcat在 7.0.73, 8.0.39, 8.5.7 版本后,添加了对于http头的验证. 具体来说,就是添加了些规则去限制HTTP头的规范性 参考这里 具体来说 ...

  2. MySql cmd下的学习笔记 —— 引擎和事务(engine,transaction)

    engine 引擎就是MySQL存储数据的不同方式 myisam 插入速度快 支持全文索引 innoDB 插入速度慢 支持事务安全 假设两人同时购买火车票,两人同时看到只有一张火车票,几乎同时下单 或 ...

  3. 解决 Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin

    QT为了简化生成发布版本,特别提供了工具 "windeplayqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目 ...

  4. LINQ Except “引用类型” 用法

    值类型的比较Except 直接就比了 正经集合类型的如下 var resultExcept = Expert_ItemSource.Except(Invert_ItemSource, new MyCo ...

  5. 新年第一个目标一张表盘串讲所有canves的知识点

    我们的目标 首先是canves的坐标系统,基于浏览器的左上角为原点,x,y轴为正方向的坐标系统. 首先初始化,打标签 <canvas id="canvas" height=& ...

  6. zookeeper安装教程

    zookeeper  一.单机安装 1.1 下载 1.2 安装 1.3 配置 1.4 启动和停止 二.伪集群模式 2.1 zookeeper1配置 2.2 zookeeper2配置 2.3 zooke ...

  7. linux mysql 定时备份 使用crontab

    第一步:在服务器上配置备份目录代码: mkdir /var/lib/mysqlbackup cd /var/lib/mysqlbackup 第二步:编写备份脚本代码:  vi dbbackup.sh ...

  8. node.js总结

    1.NPM安装报错:no such file or directory, open 'C:\Users\HP\package.json' npm WARN saveError ENOENT: no s ...

  9. ebs 12.1.1 单节点多用户安装

    本次测试环境:操作系统 oracle linux 6.9   oracle ebs 12.1.1   192.168.20.210  erpapp1.hthorizon.com erpapp1 yum ...

  10. ER/数据库建模工具之MySQL Workbench的使用

    参考:https://blog.csdn.net/soulandswear/article/details/60966808 待后续整理...