Ejemplo n.º 1
0
    def OnLastYear_adr(self, event):
        ldlg = LoginDialog(None, -1, u'登录窗口')
        ldlg.ShowModal()

        global executeflag
        print u"上一年度下载(ADR):", executeflag
        if executeflag == 1:
            executeflag = 0
            somedata = readlogininfo()
            name = somedata[0]
            password = somedata[1]
            t = threading.Thread(target=main_adr.crawler_last_year, args=(name, password))
            self.P.append(t)
            t.start()
        else:
            print u"一些东西出错了"
Ejemplo n.º 2
0
def login():
    #
    send_url(MDR_HOME_URL)
    #获取验证图片
    #send_url(AuthCodeURL)
    #获取验证码数据
    output = open(CUR_AUTH_FILE, 'wb')
    output.write(send_url(AuthCodeURL).read())
    output.close()

    somedata = readlogininfo()
    name = somedata[0]
    password = somedata[1]
    #print name,password

    code = getcode()
    print u"验证码,如若看到不是4位数字,请重新使用此操作......:", code
    #www.adrs.org.cn:114.255.93.220
    login_postdata = u"username=%s&password=%s&lt=e1s1&_eventId=submit&authCode=%s&ap=114.255.93.220" % (name, password,code)
    login_data = send_post(LOGIN_URL, login_postdata)
    
    Login_Check = login_data.find('<body onload="init();" id="cas">')
    if Login_Check == -1:
        is_login = True
    else:
        #此句表明已经跳转至login页面
        print u"login 失败",Login_Check
        return False

    send_url(MDR_JS_ADR)
    send_url(MDR_JS_MDR)
    send_url(MDR_JS_AEFI)
    send_url(MDR_JS_ENGINE)

    s2 = send_url(secondHome)
    s3 = send_url(thirdHome)


    return is_login
Ejemplo n.º 3
0
 def OnAnytime_adr(self, event):
     #
     ldlg = LoginDialog(None, -1, u'登录窗口')
     ldlg.ShowModal()
     import crawler_by_time_adr
     global executeflag
     print u"任意时间下载(ADR):", executeflag
     if executeflag == 1:
         import sd3
         sd3.MySelectDays(None, -1, u'任意天数选择')
         t1 = sd3.readini_s()
         print "t1:", t1
         t2 = sd3.readini_e()
         print "t2:", t2
         executeflag = 0
         somedata = readlogininfo()
         name = somedata[0]
         password = somedata[1]
         t = threading.Thread(target=crawler_by_time_adr.crawler_by_time, args=(name, password, t1, t2))
         self.P.append(t)
         t.start()
     else:
         print u"一些东西出错了"