posting to a form with no form name

scripteaze at gmail.com scripteaze at gmail.com
Fri Nov 2 04:29:39 EDT 2007


On Nov 2, 12:04 am, "Ryan Ginstrom" <softw... at ginstrom.com> wrote:
> > On Behalf Of scripte... at gmail.com
> > posting to a form with no form name or it's just that i cant
> > find the form name.
> > can anyone explain how to either post to a form with no name
> > or, find the name of the form..here my current output, but i
> > dont see a form name, also, there is only 1 form on the page
>
> I believe you want Browser.select_form(nr=0)
>
> # Using mechanize
> #http://wwwsearch.sourceforge.net/mechanize/
>
> from mechanize import Browser
>
> browser = Browser()
> browser.open("http://example.com")
> browser.select_form(nr=0)
>
> browser['username'] = "me"
> browser['password'] = "secret"
>
> browser.submit()
>
> Regards,
> Ryan Ginstrom

also, thank you for your response




More information about the Python-list mailing list