scrapy/scrapy — pull request #185 by notsobad (2012-11-06 18:28:24+00:00)
Title: Added xpath support in FormRequest.from_response

Some form may leak name attribute or hard to get the formnumber, so I want to be able to find form by using xpath.

You can use //form[@name="reg"] , or just give an element from the form, like //form/input[@name="username"],

```python
yield FormRequest.from_response(response,
formxpath='//form[@action="/admin/reg.php"]',
formdata={'userid':'abc', 'pwd': '123'},
callback=self.parse_page,
)

# or
yield FormRequest.from_response(response,
formxpath='//form/input[@name="userid"]',
formdata={'userid':'abc', 'pwd': '123'},
callback=self.parse_page,
)
```