提示这个 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 information, see 
可以禁止提示。
 
方法一:
requests.packages.urllib3.disable_warnings()
 
 

方法二:

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的更多相关文章

  1. 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 ...

  2. 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法

    今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...

  3. python 使用requests 请求 https 接口 ,取消警告waring

    response = requests.request("POST", url, timeout=20, data=payload, headers=headers, proxie ...

  4. Requests对HTTPS请求验证SSL证书

    SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secure socket layer(SSL)安全协议是由Netscape Communication公司设计开发.该安全协议主 ...

  5. requests发送HTTPS请求(处理SSL证书验证)

    1.SSL是什么,为什么发送HTTPS请求时需要证书验证? 1.1 SSL:安全套接字层.是为了解决HTTP协议是明文,避免传输的数据被窃取,篡改,劫持等. 1.2 TSL:Transport Lay ...

  6. Python常见问题 - python3 使用requests发送HTTPS请求报certificate verify failed 错误

    当你使用 requests 发送HTTPS请求时 requests.get(url, parmas=parmas, headers=header, cookies=cookie) 出现了以下错误 HT ...

  7. python requests访问https的链接,不打开fiddler的情况下不报错;若是打开fiddler则报ssl错误,请求中添加verify=False,会报警告;若不想看到警告,有3种方式;

    import requests# import warnings# warnings.filterwarnings("ignore") #方法一#requests.packages ...

  8. python https协议和InsecurePlatformWarning问题

    本人最近在学习python,今天想使用python来抓取糗事百科网站上的一些笑话故事的,由于糗事百科的网站url采取的是https协议,所以当我按照常规的方式抓取的时候,发现不行,报错了,找了很多方法 ...

  9. Python爬虫requests请求库

    requests:pip install  request 安装 实例: import requestsurl = 'http://www.baidu.com'response = requests. ...

随机推荐

  1. [转] C#开源项目大全

      商业协作和项目管理平台-TeamLab 网络视频会议软件-VMukti 驰骋工作流程引擎-ccflow [免费]正则表达式测试工具-Regex-Tester Windows-Phone-7-SDK ...

  2. 用图片做div背景的列表布局 CSS代码

    思路: 1.因为是竖型列表,所以外层用 相对定位,这样 在不会重叠在一起 relative 2.里面用绝对位置 absolute,覆盖在图片上面 3.这里有个小技巧,我里面有个特效,文字竖立,并向右旋 ...

  3. gitlab安装与配置(Centos6.8)

    0.Centos7请参照官方文档 https://about.gitlab.com/installation/#centos-7 1. Install and configure the necess ...

  4. 微信小程序——极点日历使用方法

    极点日历github项目地址 添加至自己的小程序方法 极点日历属性接口文档 代码实例: xml: <calendar calendar-style="calendar" he ...

  5. 一图让你看懂CSS盒子模型

  6. [Forward]Sweeping the IDisposable minefield

    IDisposable has been around since the beginning of .Net.The basic premise is simple.. Developers don ...

  7. 高通 fastboot 显示

    需要在fastboot里面添加功能用于保存,记录一下fastboot显示的过程. android O新添加了选项,如下 platform/msm_shared/rules.mk ifeq ($(ENA ...

  8. e832. 从JTabbedPane中移动卡片

    To move a tab, it must first be removed and then reinserted into the tabbed pane as a new tab. Unfor ...

  9. numpy中dtype

    简单说明dtype使用方法: Rule为规则类,其中有3个字段,1为类型,2为计算规则,3为保留位数 如 :'close': Rule(float64, 1 / 10000.0, 2), 表示收盘价, ...

  10. CI框架 -- 自动加载资源

    CodeIgniter 的"自动加载"特性可以允许系统每次运行时自动初始化类库.辅助函数和模型. 如果你需要在整个应用程序中全局使用某些资源,为方便起见可以考虑自动加载它们. 支持 ...