Python获取网页
import requests
url="https://www.xxx.com/"
headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3970.5 Safari/537.36",
}
respone=requests.get(url=url,headers=headers,verify=False)
#重点记住verify就可以来访问https的网址
data=respone.content.decode("utf-8")
with open('shuju.html','w') as f:
f.write(data)