ANN: ClientForm 0.0.9 and 0.1.2a released

John J. Lee jjl@pobox.com
09 Jun 2003 20:57:06 +0100


http://wwwsearch.sourceforge.net/ClientForm/

A new stable and development release.

Changes since 0.0.8:
 * Added nr argument to HTMLForm.click method.  Multiple click-able
   controls with the same name are now accessible.
 * HTMLForm.__str__ is clearer and more useful (since the few remaining
   control types that didn't have their own class anyway now have dummy
   classes, you can distinguish all control types -- except the ones
   implemented by IgnoreControl).
 * Example code at http://wwwsearch.sourceforge.net/bits/fastmail.py
   (requires ClientCookie).

The 0.1.2a development release (with possibly-working file upload --
single files only ATM) has equivalent changes, plus a bugfix.  I will
continue to fix any bugs in the current stable version (0.0.x) for the
foreseeable future.

Interface changes from 0.0.x to 0.1.x (there are more changes to come
before a beta release):

 * Removed items argument to HTMLForm.click method, and added
   click_items and click_request_data methods.  Removed items and
   make_request methods from HTMLForm.  Made SubmitControl.click
   method private -- is now named _click, and is only called by
   HTMLForm.
 * IsindexControl is now clickable, and isindex_url has been removed,
   since it was essentially pointless.
 * Changed SelectControl so it has an attrs dict of HTML attributes.
   SELECT and OPTION HTML attributes are now separate.


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.

Simple example:

 from urllib2 import urlopen
 from ClientForm import ParseResponse

 forms = ParseResponse(urlopen("http://www.acme.com/form.html"))
 form = forms[0]
 print form
 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"))


John