forms - how to find the POST or GET variables posted by mechanize (python) -


i'm using mechanize submit form this...

import mechanize  br = mechanize.browser() br.open('http://stackoverflow.com') br.select_form(nr=0) br['q'] = "test" br.set_handle_robots(false)  response = br.submit()  print response.info() print response.read() 

using firebug can see actual variables posted are:

q test

how can retrieve these programatically using python script?

please note i'm not scraping - using example!

also, know in case posted variables obvious, since there's 1 specified - not case!

thanks :)

print br.form.get_value('q') 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -