Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

corrected syntax error in XPath

Viral Mehtadd064413a463
diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py
index d033a830e..95b38e990 100644
--- a/scrapy/http/request/form.py
+++ b/scrapy/http/request/form.py
@@ -170,8 +170,8 @@ def _get_clickable(clickdata, form):
"""
clickables = [
el for el in form.xpath(
- 'descendant::input[re.test(@type, "^(submit|image)$", "i")]'
- '|descendant::button[not(@type) or re.test(@type, "^submit$", "i")]',
+ 'descendant::input[re:test(@type, "^(submit|image)$", "i")]'
+ '|descendant::button[not(@type) or re:test(@type, "^submit$", "i")]',
namespaces={"re": "http://exslt.org/regular-expressions"})
]
if not clickables: