Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrapy.FormRequest.from_response observed to eliminate duplicate keys in formdata #3247

Closed
starrify opened this issue May 6, 2018 · 2 comments · Fixed by #3283
Closed

scrapy.FormRequest.from_response observed to eliminate duplicate keys in formdata #3247

starrify opened this issue May 6, 2018 · 2 comments · Fixed by #3283
Milestone

Comments

@starrify
Copy link
Contributor

starrify commented May 6, 2018

This looks good:

In [2]: scrapy.FormRequest('http://example.com', method='GET', formdata=(('foo', 'bar'), ('foo', 'baz')))
Out[2]: <GET http://example.com?foo=bar&foo=baz>

While here is the issue:

In [3]: response = scrapy.http.TextResponse(url='http://example.com', body='<form></form>', encoding='utf8')

In [4]: scrapy.FormRequest.from_response(response, method='GET', formdata=(('foo', 'bar'), ('foo', 'baz')))
Out[4]: <GET http://example.com?foo=baz>

(Tested with Scrapy 1.5.0 and Python 3.6.5)

@starrify
Copy link
Contributor Author

starrify commented May 6, 2018

Related code:

formdata = dict(formdata or ())

@CCInCharge
Copy link
Contributor

I'll take a look if no one's jumped on it yet.

CCInCharge added a commit to CCInCharge/scrapy that referenced this issue Jun 7, 2018
CCInCharge added a commit to CCInCharge/scrapy that referenced this issue Jun 7, 2018
CCInCharge added a commit to CCInCharge/scrapy that referenced this issue Jun 8, 2018
CCInCharge added a commit to CCInCharge/scrapy that referenced this issue Jul 25, 2018
CCInCharge added a commit to CCInCharge/scrapy that referenced this issue Jul 26, 2018
dangra added a commit that referenced this issue Aug 2, 2018
Fix #3247: Allow scrapy.FormRequest.from_response method to handle duplicate keys
@kmike kmike added this to the v1.6 milestone Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants