1. 程式人生 > >Python的第三方庫requests提示警告InsecureRequestWarning的問題

Python的第三方庫requests提示警告InsecureRequestWarning的問題

在Python3中使用以下程式碼報錯:

requests.get(url, verify=False)
錯誤程式碼如下:
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: 
方法:

在語句前加上以下程式碼即可不會被報錯:

requests.packages.urllib3.disable_warnings()
親測可用,完美!