Beispiel #1
0
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