首页 > 解决方案 > Scrapy shell 不适用于 https://www.target.com.au/

问题描述

我已经测试过我的外壳适用于其他网站,但拒绝在目标上工作。

raise self.value.with_traceback(self.tb)
twisted.web._newclient.ResponseNeverReceived: [<twisted.python.failure.Failure twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion: Connection lost.>]

标签: htmlwebweb-scrapingscrapy

解决方案


看起来该站点正在忽略基于您的用户代理字符串的请求。

这有效:

scrapy shell target.com.au --nolog --set=USER_AGENT=Mozilla

推荐阅读