from requests.packages.urllib3.exceptions import InsecureRequestWarning
# 禁用安全请求警告
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

本文介绍如何在Python中使用requests库时禁用不安全的请求警告,通过调用特定的disable_warnings方法来避免警告信息的输出。
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# 禁用安全请求警告
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

转载于:https://www.cnblogs.com/weiwei-python/p/10118999.html
1620
8608
4263

被折叠的 条评论
为什么被折叠?