python提示警告InsecureRequestWarning

在Python3中使用以下代码报错:

import requests
response = requests.get(url='', verify=False)

错误代码如下:

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advise

解决:

import requests
requests.packages.urllib3.disable_warnings()
response = requests.get(url, verify=False)

猜你喜欢

转载自www.cnblogs.com/hankleo/p/10445810.html