How to store Response in Scrapy? [closed]

血红的双手。 提交于 2021-02-08 12:11:57

问题


I want to store response of the request in scrapy .i have the following code for the time being.

     yield Request(requestURL,
                   callback=self.afterResponse)

Now what i want not to call the function afterResponse upon arrival of response but to store it here somehow so that i can extract the data of response at the same place.


回答1:


Create some variable (it can be even list if you need to keep more data) in that spider and keep that data in it.

Or create/open some file and write it as pickle or something.



来源:https://stackoverflow.com/questions/24735264/how-to-store-response-in-scrapy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!