我试图用urllib.request.open功能: “https://prenotaonline.esteri.it/login.aspx?cidsede=100001&returnUrl=//”
我可以用我的普通浏览器访问这个网页urrlib.request.open文件函数返回HTTP错误404:
import urllib.request
page = urllib.request.urlopen("https://prenotaonline.esteri.it/login.aspx?cidsede=100001&returnUrl=//").read()
print(page)
我得到以下错误:
^{pr2}$我使用的是python3.5.3
这是你在制作蜘蛛/爬行机器人时偶然发现的第一件事。在
检测机器人程序的基本方法是请求头是否包含
User-Agent
报头。在请尝试以下代码段:
相关问题 更多 >
编程相关推荐