mirror of https://github.com/scrapy/scrapy.git
Update scrapy/http/request/form.py
Co-authored-by: Adrián Chaves <adrian@chaves.io>
This commit is contained in:
parent
92dfa7176d
commit
ea03e4254f
|
|
@ -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 '')
|
||||
|
|
|
|||
Loading…
Reference in New Issue