[Tutor] Firstrade URL Authentication?

Federo federo at email.si
Sat Aug 2 17:17:48 CEST 2008


Hi Kent

Thanks for your reply. According to your instruction I have tried in Python 
interactive window the following (in my test I have used real username and 
password):

>>> import urllib2
>>> import urllib
>>> opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
>>> urllib2.install_opener(opener)
>>> params = urllib.urlencode(dict(username='user', password='pass'))
>>> f = opener.open('https://investor.firstrade.com/firstrade/login.do', params)
>>> data = f.read()
>>> f.close()
>>> f = opener.open('https://investor.firstrade.com/firstrade/mainmenu.do')
>>> data = f.read()
>>> print(data)

It printed out login page which means I wasn't able to login to the main page. 
There must be some sofisticated trick to login to www.Firstrade.com. Any Idea 
what else can I try?

Cheers, Fedo


On Fri, 1 Aug 2008 at 12:45:47, Kent Johnson wrote:

> On Fri, Aug 1, 2008 at 3:39 AM, Federo <federo at email.si> wrote:
> > Hi ..
> >
> > I have to admit that Python is really surprising me. It was lucky day a
> few
> > weeks ago I firts time start using Python. Lot's of things realy can be
> done
> > with short learning curve. Your user guieds was best place to start!
> >
> > Below is problem I am unable to solve. I would appreciate your advice or
> > even better code sample. The problem is URL authorisation.
> 
> I have a writeup on form-based authentication here:
> http://personalpages.tds.net/~kent37/kk/00010.html#e10form-based-authenticati
> on
> 
> Kent



____________________
http://www.email.si/



More information about the Tutor mailing list