def LoginPageFromIE(): """ login in the web page with username pwd and code """ ie = PAMIE() ie.navigate("https://epoint.pampers.com.cn/index.aspx") # time.sleep(10) # return ie ie.textBoxSet("email", "*****@*****.**") ie.textBoxSet("password", "sc369963SC") # Downloadcode(ie.cookieGet()) # ie.textBoxSet('yzm',GetCode(CodeFilter())) # time.sleep(15) # ie.formSubmit('form1') ie.formSubmit("fmLogin") # ie.imageClick( if ie.textBoxExists("password"): print "fail to login in, please true again" return None # ie.navigate('http://www.bjguahao.gov.cn/comm/kouqiang/ksyy.php?ksid=1040000&hpid=109') # print ie.pageGetText() # ie.javaScriptExecute(SetDocumentMode()) # ie.javaScriptExecute('document.documentMode="7";') # ie.javaScriptExecute('document.write(document.getElementsByTagName("head"))') # ie.javaScriptExecute('document.getElementsByTagName(\'head\')[0].appendChild(\'<meta http-equiv="X-UA-Compatible" content="IE=7">\');') return ie
def LoginPageFromIE(): ''' login in the web page with username pwd and code ''' global USER global PWD ie = PAMIE() ie.navigate("http://epoint.pampers.com.cn/pages/rewards.aspx?r=5979") #print ie.cookieGet() #time.sleep(10) #return ie ie.textBoxSet('email',USER) #account ie.textBoxSet('password', PWD) #pwd #Downloadcode(ie.cookieGet()) #ie.textBoxSet('yzm',GetCode(CodeFilter())) #time.sleep(15) #ie.formSubmit('form1') ie.formSubmit('fmLogin') #ie.navigate("http://epoint.pampers.com.cn/pages/redeem.aspx?p1=149") while ie.textBoxExists('password'): print 'fail to login in, try again' #ie.navigate("http://epoint.pampers.com.cn/pages/rewards.aspx?r=5979") ie.textBoxSet('email',USER) #account ie.textBoxSet('password', PWD) #pwd ie.formSubmit('fmLogin') ie.navigate("http://epoint.pampers.com.cn/pages/redeem.aspx?p1=149") #print ie.cookieGet() # prepare to in ie.javaScriptExecute('javascript:alert("plese input the ASPXAUTH and ASP.net_Session")') #print 'input ASPXAUTH value' global ASPXAUTH ASPXAUTH = raw_input('ASPXAUTH=') #print 'input asp.net_sessionid value' global ASPNET_SESSIONID ASPNET_SESSIONID = raw_input('ASPNET_SESSIONID=') #ie.navigate("http://epoint.pampers.com.cn/pages/rewards_detail.aspx?p1=149") #ie.navigate("http://epoint.pampers.com.cn/pages/redeem.aspx?p1=149") #print ie.pageGetText() #ie.javaScriptExecute(SetDocumentMode()) #ie.javaScriptExecute('document.documentMode="7";') #ie.javaScriptExecute('document.write(document.getElementsByTagName("head"))') return ie
def LoginPage(): ''' login in the web page with username pwd and code ''' ie = PAMIE() ie.navigate("http://www.bjguahao.gov.cn/comm/yyks.php?hpid=109") #time.sleep(10) #return ie ie.textBoxSet('truename','ÍõÈý') ie.textBoxSet('sfzhm', 'Éí·ÝÖ¤ºÅ') Downloadcode(ie.cookieGet()) ie.textBoxSet('yzm',GetCode(CodeFilter())) #time.sleep(15) ie.formSubmit('form1') if ie.textBoxExists('truename'): print 'fail to login in, please true again' return None #ie.navigate('http://www.bjguahao.gov.cn/comm/kouqiang/ksyy.php?ksid=1040000&hpid=109') #print ie.pageGetText() #ie.javaScriptExecute(SetDocumentMode()) #ie.javaScriptExecute('document.documentMode="7";') #ie.javaScriptExecute('document.write(document.getElementsByTagName("head"))') #ie.javaScriptExecute('document.getElementsByTagName(\'head\')[0].appendChild(\'<meta http-equiv="X-UA-Compatible" content="IE=7">\');') return ie