可以通过使用urllib3.disable_warnings()接口将发送request请求时弹出的安全类警告屏蔽,示例如下:
import requests
from requests.packages import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
url = "https://www.booking.com/searchresults.en-gb.html"
with requests.Session() as s:
r = s.get(url, verify=False)
html = r.text
标签:warnings,InsecureRequestWarnings,打印,urllib3,disable,html,import,警告,requests
From: https://www.cnblogs.com/LuckyOven/p/16835241.html