mirror of https://github.com/scrapy/scrapy.git
FormRequest: fix unicode xpath exception
This commit is contained in:
parent
395ef805eb
commit
4f98be60be
|
|
@ -85,7 +85,8 @@ def _get_form(response, formname, formid, formnumber, formxpath):
|
|||
el = el.getparent()
|
||||
if el is None:
|
||||
break
|
||||
raise ValueError('No <form> element found with %s' % formxpath)
|
||||
encoded = formxpath if six.PY3 else formxpath.encode('unicode_escape')
|
||||
raise ValueError('No <form> element found with %s' % encoded)
|
||||
|
||||
# If we get here, it means that either formname was None
|
||||
# or invalid
|
||||
|
|
|
|||
Loading…
Reference in New Issue