python3.7 requests請求HTTPS警告解決辦法

  • 警告InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See:...
  • Stack Overflow上大牛給出的結局方案加兩行代碼(新版)
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  • 老版本解決辦法
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)


這裏是urlopen請求https證書驗證錯誤解決辦法: http://www.javashuo.com/article/p-bxbyavzu-ds.htmlhtml


原文連接: https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pythopython

相關文章
相關標籤/搜索