Automatically populate and submit HTML Forms

rbt rbt at athop1.ath.vt.edu
Wed May 25 14:44:52 EDT 2005


How can I make a python client script connect to a Web server and 
automatically populate form fields and then submit the form?

For example, say I wanted to check and see if 1924 was a leap year... 
how would I populate the 'year' field and then submit it for processing? 
I have no control of the server... just the client script.

<form action="cgi-bin/leapyear.py">
  <p>Enter a year and find out if it's a leap year:
  <input type="text" name="year" size="6">
  <input type="submit">
  <input type="reset">
</form>

Many thanks,

rbt



More information about the Python-list mailing list