beating a dead horse: automated form submission

Peter Hansen peter at engcorp.com
Sat Jan 25 21:13:12 CET 2003


Whit Whitfield wrote:
> 
> I have searched google groups and docs/faqs for days and cannot seem
> to get my
> script to automate a form submission to work correctly.  I am trying
> to mimic
> an end user and can communicate with the page via httplib, but cannot
> figure out how to actually submit the data.  Any help is appreciated,

You would have to retrieve the URL from the "action" attribute in the form
element and, depending on whether the method attribute was GET or POST,
either append all the form data to that URL following a question mark 
(for GET), or submit the form data as the request content (for POST)
after the header, again using the action URL.

To help you further, I'd have to see what you've been trying.  Can you
not post a snippet or two of your code for us to review?

-Peter




More information about the Python-list mailing list