Update scrapy/http/request/form.py

Co-authored-by: Adrián Chaves <adrian@chaves.io>
This commit is contained in:
Ammar Najjar 2020-08-26 11:43:52 +00:00 committed by GitHub
parent 92dfa7176d
commit ea03e4254f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ def _get_clickable(clickdata, form):
# We didn't find it, so now we build an XPath expression out of the other
# arguments, because they can be used as such
xpath = './/*' + ''.join(f'[@{key}="{clickdata[key]}"]' for key in clickdata)
xpath = './/*' + ''.join(f'[@{k}="{v}"]' for k, v in clickdata.items())
el = form.xpath(xpath)
if len(el) == 1:
return (el[0].get('name'), el[0].get('value') or '')