I am using scrapy to scrape some data, I am wondering how much data of Request the Response stores.
My specific question is shown in the following code:
def parse(self,response):
r = FormRequest(url=url1, formdata={somedata}, callback=parse2)
#is this line necessary if I want the formdata being attached?
r.meta['formdata'] = formdata
yield r
def parse2(self,response):
#can I access to the formdata here without that line of code?
Any suggestion would be appreciated.
Yes, however formdata
is already converted into body
and won't be the dictionary but a string as far as I remember.
so try r.body
also quick reminder you can check the attributes of an object by:
dir(r)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With