#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    81
    Rep Power
    12

    Python Posting to a Form


    Hi, I want to fill out a web form, make changes to selected listboxes etc. I have been looking on google, and I see a few options like pycurl, and urllib2. I have not found good examples of what I want to do. Can anyone recommend which module I should be using, and any sites that will help? Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    WebUnit (http://webunit.sourceforge.net/) may do what you want, but I have not used it.

    HttpUnit (http://httpunit.sourceforge.net/) will definitely do what you want. It is written in Java, but can be called from Jython.

    Dave - The Developers' Coach
  4. #3
  5. Cast down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    321
    Rep Power
    11
    Update: Whoops, read your question wrong, the bottom is prob not what you want, I'll keep it here in case it helps others though:

    To read from a form, you can also do it using the cgi module, something like:

    HTML
    form action="asdf.py" method="GET"
    input name="name" type="text"
    input type="submit" value="k"

    python:
    a = cgi.FieldStorage()
    print 'Content-type: text/plain\n'
    if a.has_key('name'): print 'Hey', a['name']
    Last edited by movEAX_444; September 9th, 2004 at 11:04 AM.

IMN logo majestic logo threadwatch logo seochat tools logo