On Sun, Aug 3, 2008 at 12:45 PM, Federo <[EMAIL PROTECTED]> wrote: > Jeff, Kent Hi! > > If possible I would most appreciate to use mechanize approach Jeff suggested. > Python plagin: http://wwwsearch.sourceforge.net/mechanize/
This seems to get to the "Thank you for applying for a Firstrade account." page: import urllib2 import urllib opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) urllib2.install_opener(opener) f = opener.open('https://investor.firstrade.com/firstrade/login.do') data = f.read() f.close() params = dict(username='janezfedero', password='kmet500', destination='') params['login.x'] = 'Log+In' params = urllib.urlencode(params) f = opener.open('https://investor.firstrade.com/firstrade/login.do', params) data = f.read() f.close() print(data) Differences from your code: - Does a GET on the login page - the session cookie is set here, not on the POST - Includes all the form parameters Kent PS Please respond to the list, not to me personally. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor