This is a discussion on ANN: ClientForm 0.0.10 and 0.1.3a released - Python ; http://wwwsearch.sourceforge.net/ClientForm/ A new stable and development release. Changes from 0.0.9 to 0.0.10: * Changed license from MIT to BSD, to make it easier to use other code. The only difference is the addition of a non-endorsement clause. * Default value ...
A new stable and development release.
Changes from 0.0.9 to 0.0.10:
* Changed license from MIT to BSD, to make it easier to use other code.
The only difference is the addition of a non-endorsement clause.
* Default value for single-selection SELECT controls was wrong.
Before, nothing was selected if select_default argument to
ParseResponse / ParseFile was False (the default). Now, the first
item is selected, as documented. Thanks to Chris Curvey.
* Fixed exceptions raised by HTMLForm.__getitem__ / .__setitem__
* RadioControl now has default value "on" -- same as for
CheckboxControl. Both IE5 and Mozilla Firebird 0.6 do this.
* CHECKBOX and multiple SELECT controls now allow
control.value = None, for consistency.
* Parse errors may now be ignored, thanks to ignore_errors
argument to ParseFile and ParseResponse.
* Other minor changes.
Changes from 0.1.2a to 0.1.3a:
* Equivalent changes to those listed above.
* Added HTMLForm.set and HTMLForm.clear methods (and corresponding
control methods). Useful!
* A minor 2.3 compatibility fix.
Note that there will be a couple more interface changes before a 0.1.x
beta release (the only important planned change relates to the
disabled attribute). Multi-file upload is still not implemented.
Requires Python >= 1.5.2.
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.acme.com/form.html"))
form = forms
form["author"] = "Gisle Aas"
# form.click returns a urllib2.Request object
# (see HTMLForm.click.__doc__ if you don't have urllib2)
response = urlopen(form.click("Thanks"))