如何解决Scrapy Shell请求与响应不匹配?
以下是我在PyCharm终端中运行的代码:
scrapy shell "https://www.puppis.com.ar/perros/alimentos/alimentos-secos#2"
输出:
Available Scrapy objects:
[s] scrapy scrapy module (contains scrapy.Request,scrapy.Selector,etc)
[s] crawler <scrapy.crawler.Crawler object at 0x000001F4B3F77AF0>
[s] item {}
[s] request <GET https://www.puppis.com.ar/perros/alimentos/alimentos-secos#2>
[s] response <200 https://www.puppis.com.ar/perros/alimentos/alimentos-secos>
[s] settings <scrapy.settings.Settings object at 0x000001F4B3F77160>
[s] spider <DefaultSpider 'default' at 0x1f4b4442d30>
[s] Useful shortcuts:
[s] fetch(url[,redirect=True]) Fetch URL and update local objects (by default,redirects are followed)
[s] fetch(req) Fetch a scrapy.Request and update local objects
[s] shelp() Shell help (print this help)
[s] view(response) View response in a browser
为什么响应输出与请求URL不同?
据我了解,带有“#2”的页面被重定向到主页-最后没有“#2”。有什么办法可以避免这种情况的发生?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。