当使用 requests 库发送请求时报了以下警告

D:\python3.6\lib\site-packages\urllib3\connectionpool.py:847: 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()