I wanted to have a Python program make my browser do a POST.  I am using
Firefox on Linux.

Here's what I did:
* Prepare a HTML page on the local disk that looks like this:
<html><body onload="document.forms[0].submit()">
    <div style="display: none">
    <form method=post accept-charset="utf-8" 
action="http://www.example.com/cgi-bin/example.cgi";>
        <input name=field1 value=value1>
        <input name=field2 value=value2>
        <textarea name=text>....</textarea>
        <input type=submit name=blah>
    </form>
    </div>
    Submitting form...
</body>
</html>

* Point the webbrowser at it.  In my case, the webbrowser module didn't work 
immediately so I 
  just used os.system() with a hardcoded browser name for it

Jeff

Attachment: pgpRarqrD1itP.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to