admin管理员组文章数量:1245188
I use this request to do form request using scrapy splash, but it said the method was NONE and Splash can only process GET and POST
yield SplashFormRequest(url,
args={'wait': 5,
'http_method':"POST",
'body' : body,
'cookies':cookie},
headers=headers,
callback=self.parse_listings,
dont_filter=True)
How to make it POST method?
I use this request to do form request using scrapy splash, but it said the method was NONE and Splash can only process GET and POST
yield SplashFormRequest(url,
args={'wait': 5,
'http_method':"POST",
'body' : body,
'cookies':cookie},
headers=headers,
callback=self.parse_listings,
dont_filter=True)
How to make it POST method?
Share Improve this question asked Feb 16 at 6:08 Aminah NurainiAminah Nuraini 19.2k9 gold badges97 silver badges113 bronze badges2 Answers
Reset to default 0When I open the source code of SplashFormRequest, their code is inconsistent with SplashRequest. SplashRequest declares the method in args, while SplashFormRequest declares the method like a standard Scrapy Request. I fixed it by rewriting it like this.
yield SplashFormRequest(url,
method="POST",
args={'wait': 5,
'body' : body,
'cookies':cookie},
headers=headers,
callback=self.parse_listings,
dont_filter=True)
You haven't passed formdata
to SplashFormRequest
, and so you don't actually need SplashFormRequest
. If you passed formdata
you wouldn't get this error because FormRequest
sets method
to POST
if it's None and formdata
is passed.
本文标签: Scrapy Splash Form Request method is not POSTStack Overflow
版权声明:本文标题:Scrapy Splash Form Request method is not POST - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740215300a2242749.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论