automatically filling web forms?

Randall Hopper aa8vb at yahoo.com
Tue Jul 18 09:52:51 EDT 2000


Jeroen Valcke:
 |Thanks for this sample code, it helped me alot!

Sure.

 |Also, a small question about the code what about the file you open in the
 |code, is that to write results?  because the file never gets created when
 |i run the program, I don't need results too.

Right.  The file I opened ('tfp = open(...)') is to store the POST query
results.  urlretrieve does this all nicely for you under-the-hood, but in
the Python 1.5.2 version it doesn't support passing POST CGI arguments.

The file probably gets created for a POST query (I was using that part of
the code for something recently so I'm pretty sure).  But if you left the
'os.unlink( filename )' code at the bottom, it gets cleaned up before the
script exists.

If you're using a GET query, the temp file gets cleaned up by urlcleanup().

Randall




More information about the Python-list mailing list