Automating Form Submission

Greg Jorgensen gregj at pobox.com
Sun Feb 18 05:37:18 EST 2001


On Sun, 18 Feb 2001 12:04:28 +0800, John Bell <jbell at iinet.net.au>
wrote:

>Pythonistas,
>
>I am an experienced Perl programmer just beginning to look at Python
>as I need a scripting langusge for a large project which involves a wide
>range of technologies.  I know from bitter experience that Perl quickly
>becomes unwieldly as project size and complexity increases.
>
>I am impressed by Python, and in evaluating its suitability for the
>project at hand have found extensions to cover all areas of need
>but one: Automation of Submission of Web based Forms.
>
>I am probably missing something, but cannot find support for escaping
>of responses (as per Perl's URI::Escape::uri_escape), support for
>Forms processing (GET and POST methods as per Perl's LWP::Simple
>and LWP::UserAgent modules respectively) or any support for capture
>and use of Cookies.
>
>At first view Python seems very good in the Web Server department,
>but not so good in the Web Client area.  I think I must be missing something,
>as I would have expected all this functionality to be written as part of the 
>Grail project.
>
>Please tell me I've got it wrong!

You've got it wrong. The standard Python distribution includes modules
for quoting/unquoting (escaping) URLs (urllib), submitting, receiving,
and processing GET and POST requests (httplib), and for parsing
MIME-encoded data (mimetools) and RFC822-format headers (rfc822). Of
course there is a module implementing CGI (cgi). Everything you need
is there.

You will find the book "Python Essential Reference" by David Beazley
(published by New Riders) very useful.


Greg Jorgensen
Deschooling Society
Portland, Oregon USA



More information about the Python-list mailing list