get website to handle quote request
get cookie of quote list from website www.investorsedge.cibc.com
get request variables and their values
get website opener
import urllib2
import urllib;
opener = urllib2.build_opener()
set cookie
cookie_name="1799%5F0" # it is fixed and not changed
cookie_value="C73592D6960210DBA1034E5A626CB0FD" # changed every day
opener.addheaders.append(('Cookie', cookie_name+"="+CookieValue))
get quote stream
params = urllib.urlencode({
"target":"WsodFrame",
"location":"https://www.onlinebrokerage.cibc.com:443/Customer/wSODRequest.cibc?pageName=myQuoteLists",
"linkAction":"https://www.onlinebrokerage.cibc.com:443/Customer/wSODRequest.cibc?pageName=myQuoteLists&Action=",
"symbolList" :"BNS::63988::CA::EQ|CM::77273::CA::EQ|TD::266163::CA::EQ"
})
read stream
f = opener.open(
"https://www.cibc.wallst.com/research/quotelists/quotelist/quotelist.asp?YYY410_9FKKKB+esPllCbiLcwJG8S4Uohb/7nSiY4rumyG71k2dluEd6leohvgrb"+
"YdWJ11OZTb9x6Dlf/H42Iigiuguh5Y6ZeDyjhrdjtTli84UGiPFgxQBfD3dTz+"+
"4QXvrU1sjBLpSwEti6xhk4AufrkXZDQ=="
,params
);
f.read()