Issue
If we use requests
and we need Passing Parameters In URLs we can use params
import requests
params = (
('q', 'scrapy'),
)
response = requests.get('https://github.com/search', params=params)
response.url will be
In [4]: response.url
Out[4]: 'https://github.com/search?q=scrapy'
https://2.python-requests.org//en/latest/user/quickstart/#passing-parameters-in-urls
But how Passing Parameters In URLs if we use Scrapy?
Solution
Need use FormRequest
with GET method and pass params
in formdata
return FormRequest(url='https://github.com/search',
method='GET',
headers=headers,
formdata=params,
callback=self.parse_data)
Answered By - Serhii
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.