resp = requests.post(url= https://www.baidu.com/ , headers=headerr,verify=False) datacount = resp.content.decode( utf-8 ) print(datacount)
自己拿去用吧
headerr={ Host : www.baidu.com } def baidu(): resp = requests.post(url= https://www.baidu.com/ , headers=headerr,verify=False) datacount = resp.content.decode( utf-8 ) print(datacount)
复制粘贴完事了
啥都没出来呀
装库啊
没看见绿色的下划线
from urllib.request import urlopen url= http://www.baidu.com resp=urlopen(url) with open( baidu.html , wb ) as fobj: fobj.write(resp.read()) print( 保存成功 )
拿去不用客气
可以了,多谢