I have tried but I recived error. Look attached files: FormManagementCode (my code) and FormManagement_Note (headers information). There must be some additional trick to fully master form management ..
Fake account is now active. URL: https://investor.firstrade.com/firstrade/login.do On screen: We are enetring Symbole field at the top right User: janezfedero Pass: kmet500 (I left login credentials also in the attached code) Cheers, Fedo On Mon, 4 Aug 2008 at 16:08:33, Kent Johnson wrote: > On Mon, Aug 4, 2008 at 8:05 AM, Federo <[EMAIL PROTECTED]> wrote: > > Kent THANKS! It works great also on real account .. > > > > Two important Sub-QUESTIONS: > > > > 1.) Look attached word file. It describes form fields I would like to fill > in > > and read server resoult.. > > You just have to mimic what the browser does. Use a Firefox plugin > that shows you what is being submitted; TamperData is one. Then set > the same fields in your code. > > > 2.) Could you do the same login logic also with MECHANIZE plagin. There > are > > some very usefull function in this plagin I might use. However I have > > No, I'm not familiar with mechanize. > > Kent ____________________ http://www.email.si/
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)
params = dict(username='janezfedero', password='kmet500', destination='',
contentProvider='pinnacor', quoteSymbol='XSNX', optionChain='XSNX',
countryCode='US', optionRange='NTM', tickerSymbol='XSNX',
contentType='stockquote', quote.x='submitted')
params['login.x'] = 'Log+In'
params = urllib.urlencode(params)
f = opener.open('https://investor.firstrade.com/firstrade/mainmenu.do', params)
data = f.read()
f.close()
print(data)
FormManagement_Note.rtf
Description: FormManagement_Note.rtf
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
