InsecureRequestWarning: Unverified HTTPS request is being made.

问题描述:
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)

解决:
禁用安全请求警告

  • 如果requests >= 2.16.0
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  • 如果requests < 2.16.0
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho