Subversion Repositories SmartDukaan

Rev

Rev 17112 | Rev 17118 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17112 Rev 17114
Line 260... Line 260...
260
            
260
            
261
            
261
            
262
def track(url, orderId):
262
def track(url, orderId):
263
    br = getBrowserObject()
263
    br = getBrowserObject()
264
    br.set_proxies({"http": PROXY_MESH_GENERAL})
264
    br.set_proxies({"http": PROXY_MESH_GENERAL})
265
    br.open(url)
-
 
266
    response = br.open(url)
265
    response = br.open(url)
267
    ungzipResponseBr(response, br)
266
    ungzipResponseBr(response, br)
268
    soup = BeautifulSoup(br.response())
267
    soup = BeautifulSoup(br.response())
269
    csrf = soup.find('input', {'name': '_csrf'}).get('value')
268
    csrf = soup.find('input', {'name': '_csrf'}).get('value')
270
    print csrf
269
    print csrf
271
    #html = response.read()
270
    #html = response.read()
272
    #print html
271
    #print html
273
    br.select_form(name='trackForm')
272
    br.select_form(name='trackForm')
274
    br.form['orderId'] = str(orderId)
273
    br.form['orderId'] = str(orderId)
275
    br.form['_csrf'] = str(csrf)
-
 
276
    response = br.submit()
274
    response = br.submit()
277
    print "********************"
275
    print "********************"
278
    print "Attempting to Login"
276
    print "Attempting to Login"
279
    print "********************"
277
    print "********************"
280
    #ungzipResponse(response, br)
278
    #ungzipResponse(response, br)