python requests 请求禁用SSL警告信息解决

Python3 requests模块发送HTTPS请求,关闭SSL 验证,控制台会输出以下错误:

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

解决办法:

禁用安全警告信息

import requests
requests.packages.urllib3.disable_warnings()

 

posted on 2019-01-09 16:43  梦雨情殇  阅读(6420)  评论(0编辑  收藏  举报

导航