i’m using mechanize to submit a form like 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 i can see that the actual variables posted are:
q test
how can i retrieve these programatically using my python script?
please note i’m not actually scraping SO – just using it as an example!
also, i know in this case the posted variables are obvious, since there’s only the one i specified – often this is not the case!
thanks 🙂
1 Answer