我正在使用python3和scrapy。我正在用这个代码获取scrapy shell:
url = "https://www.urban.com.au/projects/melbourne-square-93-119-kavanagh-street-southbank"
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
fet = scrapy.Request(url, headers=headers)
fetch(fet)
它正在显示DEBUG: Crawled (403)
请分享任何想法与返回200响应在scrapy shell。你知道吗
你需要模仿和真正的浏览器完全相同的标题
403错误-因为网站显示验证码。
如果解析验证码并提取cookie,它将工作。
使用
requests
进行调试的示例:如果你在浏览器中打开它,它会显示fill captcha以继续。因此,对于来自计算机的高流量,它将要求额外的身份验证。你知道吗
所以你看到的是403
相关问题 更多 >
编程相关推荐