diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py index 53470825f..3167ed273 100644 --- a/scrapy/http/request/form.py +++ b/scrapy/http/request/form.py @@ -49,14 +49,15 @@ def _get_form(response, formname, formnumber, formxpath): """Find the form element """ from scrapy.selector.lxmldocument import LxmlDocument root = LxmlDocument(response, lxml.html.HTMLParser) - if not root.forms: + forms = root.xpath('//form') + if not forms: raise ValueError("No