The old 0.0.x series is no longer supported.
This is a bugfix release. Changes from 0.1.16 to 0.1.17:
* Fix case where FORM action contains a '?' or '#' (again!). * Fix failure to raise ParseError (!) * Workaround for failure of sgmllib to unescape attributes (bug report from Titus Brown). * Fix image control in case where value is present. * Hack choose_boundary not to fail on hostname lookup. * Allow user to supply own Request class. * Fix ISINDEX action URL (bug only showed up in Python 2.4).
Requires Python >= 1.5.2. Works with Python 2.4.
ClientForm is a Python module for handling HTML forms on the client side, useful for parsing HTML forms, filling them in and returning the completed forms to the server. It has developed from a port of Gisle Aas' Perl module HTML::Form, from the libwww-perl library, but the interface is not the same.
from urllib2 import urlopen from ClientForm import ParseResponse
forms = ParseResponse(urlopen("http://www.example.com/form.html")) form = forms print form form["author"] = "Gisle Aas"
# form.click returns a urllib2.Request object # (see HTMLForm.click_request_data.__doc__ if you're not using urllib2) response = urlopen(form.click("Thanks"))