requests请求时设置了 verify=False
不验证证书,运行时控制台会打印出警告,如何关闭警告?
添加以下代码即可
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
完整代码
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
r = requests.get('https://hilxy.com', verify=False)
print(r.status_code)
print(response.text)
评论