web - python urllib2 - login and specify a form in page -


i trying log in forum using python/urllib2. can't seem succeed. think might because there several form objects in login page, , submit incorrect 1 (the same code worked different forum, single form).

is there way specify form submit in urllib2?

thanks.

here can give steps achieve goal:

  1. read page using urllib2

  2. parse page dom object ( see xml.dom.minidom.parsestring or other equivalent)

  3. search if page has login form serching form id etc.

  4. if form there, create form click using code (create http headers, response data). , post information using urllib2 http methods ( or post or ajax, header documented @ w3c school)


Comments