scrapy/http/request/form.py
changed.
Showing 1 of 1 files from the diff.
@@ -12,7 +12,6 @@
Loading
12 | 12 | from w3lib.html import strip_html5_whitespace |
|
13 | 13 | ||
14 | 14 | from scrapy.http.request import Request |
|
15 | - | from scrapy.utils.python import to_bytes, is_listlike |
|
16 | 15 | from scrapy.utils.response import get_base_url |
|
17 | 16 | ||
18 | 17 |
@@ -27,8 +26,7 @@
Loading
27 | 26 | super().__init__(*args, **kwargs) |
|
28 | 27 | ||
29 | 28 | if formdata: |
|
30 | - | items = formdata.items() if isinstance(formdata, dict) else formdata |
|
31 | - | querystr = _urlencode(items, self.encoding) |
|
29 | + | querystr = urlencode(formdata, doseq=1, encoding=self.encoding) |
|
32 | 30 | if self.method == 'POST': |
|
33 | 31 | self.headers.setdefault(b'Content-Type', b'application/x-www-form-urlencoded') |
|
34 | 32 | self._set_body(querystr) |
@@ -67,13 +65,6 @@
Loading
67 | 65 | return urljoin(form.base_url, url) |
|
68 | 66 | ||
69 | 67 | ||
70 | - | def _urlencode(seq, enc): |
|
71 | - | values = [(to_bytes(k, enc), to_bytes(v, enc)) |
|
72 | - | for k, vs in seq |
|
73 | - | for v in (vs if is_listlike(vs) else [vs])] |
|
74 | - | return urlencode(values, doseq=1) |
|
75 | - | ||
76 | - | ||
77 | 68 | def _get_form(response, formname, formid, formnumber, formxpath): |
|
78 | 69 | """Find the form element """ |
|
79 | 70 | root = create_root_node(response.text, lxml.html.HTMLParser, |
Files | Coverage |
---|---|
scrapy | 88.02% |
Project Totals (158 files) | 88.02% |
478119282
478119282
478119282
478119282
478119282
478119282
478119280
478119280
478119280
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.