Exemple #1
0
    def get_forms(self, url=None, *args, **kw):
        posturl = url or self.get_url()
        fifo = StringIO()
        fifo.writelines(self.get_html(url, *args, **kw))
        fifo.seek(0)
        forms = ClientForm.ParseFile(fifo, posturl, backwards_compat=False)

        return [FORM(self, form) for form in forms]
Exemple #2
0
dir_name = ""
local_dir_state = False

#
#if len(sys.argv)==2:
#	local_dir_state=True
#	dir_name=sys.argv[1]

if (local_dir_state == False):
    #login
    #dir = os.path.dirname("/home/ijij41/clawler/")
    #os.chdir(dir)
    dir = os.path.dirname("/archive/web/html/ubi/")
    os.chdir(dir)
    html = open('login.asp')
    forms = ClientForm.ParseFile(
        html, 'http://www.u-express.com/login/LoginProc.asp')
    form = forms[0]
    #print form
    form['id'] = 'dream2011'
    form['pwd'] = 'dream'
    request = form.click()
    response = urllib2.urlopen(request, timeout=5)
    #print response.read()

    #get all information
    for kiosk_num in kiosk_list.keys():
        locker_info[kiosk_num] = getKioskData(kiosk_num)

    standard_date = datetime.datetime.now()
    oneday_before = standard_date - datetime.timedelta(days=1)