禁止requests请求https的提示InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more

方法二:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
方法三
import warnings
warnings.filterwarnings("ignore")
方法四:
import urllib3
warnings.simplefilter('ignore',category=urllib3.exceptions.InsecureRequestWarning)
此方法比上面方法三更细腻,方法三这样做是禁止了所有模块的warning,打击面积有点大。既然是warning,那就最好不要都禁止了。方法四只禁止InsecureRequestWarning
禁止requests请求https的提示InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more的更多相关文章
- pip安装模块警告InsecurePlatformWarning: A true SSLContext object is not available.
在用pip7.1.2版本安装第三方模块时出现了如下警告: /usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/reques ...
- 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法
今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...
- python 使用requests 请求 https 接口 ,取消警告waring
response = requests.request("POST", url, timeout=20, data=payload, headers=headers, proxie ...
- Requests对HTTPS请求验证SSL证书
SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secure socket layer(SSL)安全协议是由Netscape Communication公司设计开发.该安全协议主 ...
- requests发送HTTPS请求(处理SSL证书验证)
1.SSL是什么,为什么发送HTTPS请求时需要证书验证? 1.1 SSL:安全套接字层.是为了解决HTTP协议是明文,避免传输的数据被窃取,篡改,劫持等. 1.2 TSL:Transport Lay ...
- Python常见问题 - python3 使用requests发送HTTPS请求报certificate verify failed 错误
当你使用 requests 发送HTTPS请求时 requests.get(url, parmas=parmas, headers=header, cookies=cookie) 出现了以下错误 HT ...
- python requests访问https的链接,不打开fiddler的情况下不报错;若是打开fiddler则报ssl错误,请求中添加verify=False,会报警告;若不想看到警告,有3种方式;
import requests# import warnings# warnings.filterwarnings("ignore") #方法一#requests.packages ...
- python https协议和InsecurePlatformWarning问题
本人最近在学习python,今天想使用python来抓取糗事百科网站上的一些笑话故事的,由于糗事百科的网站url采取的是https协议,所以当我按照常规的方式抓取的时候,发现不行,报错了,找了很多方法 ...
- Python爬虫requests请求库
requests:pip install request 安装 实例: import requestsurl = 'http://www.baidu.com'response = requests. ...
随机推荐
- c语言编程-----指向二维数组的指针
c中如何返回一个指向二维数组的指针 #include <stdio.h> #include <stdlib.h> #define COUNT 3 typedef int (*M ...
- DbgPrint/KdPrint输出格式控制
在驱动编程学习中,往往需要通过DbgPrint或者KdPrint来输出调试信息,对于Check版本,KdPrint只是DbgPrint的一个宏定义,而对于Free版本,KdPrint将被优化掉.这些输 ...
- MVC的JavaScriptResult使用
JavaScriptResult的使用有两个必要的前提: 1.Ajax 2.jquery.unobtrusive-ajax.js 使用代码示例 controller public ActionResu ...
- es cat http://localhosts:9002/_cat/nodes?v
http://localhosts:9002/_cat/nodes?v&h=http,version,jdk,disk.total,disk.used,disk.avail,disk.used ...
- PCL点云特征描述与提取(3)
快速点特征直方图(FPFH)描述子 已知点云P中有n个点,那么它的点特征直方图(PFH)的理论计算复杂度是,其中k是点云P中每个点p计算特征向量时考虑的邻域数量.对于实时应用或接近实时应用中,密集点云 ...
- git 无法提交空目录
git不能提交子文件夹? 空目录无法add,在最里面的目录下加上随便加上一个txt就可以了
- 如何在Linux系统上安装字体
libreoffice添加字体 TrueType字体文件的扩展名是.ttf,ttf就是TrueType Font的首字母缩写 一般在 /usr/share/fonts/truetype/ 目录下,这个 ...
- 【转】为什么说 Java 程序员必须掌握 Spring Boot ?
Spring Boot 2.0 的推出又激起了一阵学习 Spring Boot 热,那么, Spring Boot 诞生的背景是什么?Spring 企业又是基于什么样的考虑创建 Spring Boot ...
- Qt安装过程中: configure 时发生的经典出错信息之”Basic XLib functionality test failed!”(Z..z..) 之 MySQL support cannot be enabled due to functionality test!
整出错信息是在./configure阶段Basic XLib functionality test failed!You might need to modify the include and li ...
- C语言简明数据类型指南
一.常用的数据类型 char:字符在计算机的存储器中以字符编码的形式保存,字符编码是一个数字,因此在计算机看来,A与数字65完全一样(65是A的ASCII码). int:如果要保存一个整数,通常可以使 ...