Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 刮削分页:无限滚动分页_Python_Web Scraping_Scrapy - Fatal编程技术网

Python 刮削分页:无限滚动分页

Python 刮削分页:无限滚动分页,python,web-scraping,scrapy,Python,Web Scraping,Scrapy,我正试图从数据库中获取数据。我已经设法从网站的第一页抓取了数据 但对于下一页,网站使用AJAX加载数据,为此,我设置了标题,但无法从下一页获取数据 如果我们在没有标题的情况下向网站发送请求,我们会得到相同的数据。因此,可能我没有以正确的方式设置标题以移动到下一页。我用头 我哪里做错了 您的代码正在重用相同的键,这可能是导致再次加载相同页面的原因。尝试从标题中删除“键”,或确定它们是如何创建的 以下是我在初步检查中发现的钥匙 https://monark.com.pk/collections/t

我正试图从数据库中获取数据。我已经设法从网站的第一页抓取了数据

但对于下一页,网站使用AJAX加载数据,为此,我设置了标题,但无法从下一页获取数据

如果我们在没有标题的情况下向网站发送请求,我们会得到相同的数据。因此,可能我没有以正确的方式设置标题以移动到下一页。我用头

我哪里做错了


您的代码正在重用相同的键,这可能是导致再次加载相同页面的原因。尝试从标题中删除“键”,或确定它们是如何创建的

以下是我在初步检查中发现的钥匙

https://monark.com.pk/collections/t-shirts?key=172181120&custom_constraint=custom-filter+page=4&view=ajax&_=1618763278994
https://monark.com.pk/collections/t-shirts?key=205204897&custom_constraint=custom-filter+page=5&view=ajax&_=1618763278995
https://monark.com.pk/collections/t-shirts?key=172181120&custom_constraint=custom-filter+page=4&view=ajax&_=1618763278994
https://monark.com.pk/collections/t-shirts?key=205204897&custom_constraint=custom-filter+page=5&view=ajax&_=1618763278995