问题
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