def get_proxy(): s=requests.session() test_url='http://fly.elal.co.il/plnext/ELALonlinebooking/Override.action' test2_url='http://booking.elal.co.il/newBooking/urlDirector.do' good=False while good is False: cur_proxy = replace_proxy() print "Need Proxy... {0}".format(cur_proxy) try: test=s.get(test_url) except: test = dummy() #if 'Access Denied' not in test.text and test.status_code == 200 and 'Manual Runner' not in test.text: if 'Access Denied' not in test.text and 'Manual Runner' not in test.text: good = True
def get_proxy(): s = requests.session() test_url = 'http://fly.elal.co.il/plnext/ELALonlinebooking/Override.action' test2_url = 'http://booking.elal.co.il/newBooking/urlDirector.do' good = False while good is False: cur_proxy = replace_proxy() print "Need Proxy... {0}".format(cur_proxy) try: test = s.get(test_url) except: test = dummy() #if 'Access Denied' not in test.text and test.status_code == 200 and 'Manual Runner' not in test.text: if 'Access Denied' not in test.text and 'Manual Runner' not in test.text: good = True
dict['journeyType']="1" dict['departDay']=Start.strftime("%d") dict['departMonth']=int(Start.strftime("%m"))-1 dict['returnDay']=Ret.strftime("%d") dict['returnMonth']=int(Ret.strftime("%m"))-1 dict['returnYear']=Ret.strftime("%Y") dict['departureYear']=Start.strftime("%Y") dict['lang']="IL" dict['returnFrom']=DST dict['returnTo']="TLV" dict['cabin']="Economy" dict['coupons']="" s=requests.session() url2='http://booking.elal.co.il/newBooking/urlDirector.do' #?OWASP_CSRFTOKEN='+token x="" r3=dummy() try: r2=s.post(url2,data=dict) posts=up.getPostVals() posts.feed(r2.text) dict={} for i in posts.inputs: if 'id' in i: dict[i['id']]=i['val'] url3='http://fly.elal.co.il/plnext/ELALonlinebooking/Override.action' r3=s.post(url3,data=dict) d3=[] x=r3.text[r3.text.find("generatedJSon"):r3.text.find("\n", r3.text.find("generatedJSon"))] y=x[28:-4] w=eval(y.replace('false', 'False').replace('true','True'))
dict['departMonth'] = int(Start.strftime("%m")) - 1 dict['returnDay'] = Ret.strftime("%d") dict['returnMonth'] = int(Ret.strftime("%m")) - 1 dict['returnYear'] = Ret.strftime("%Y") dict['departureYear'] = Start.strftime("%Y") dict['lang'] = "IL" dict['returnFrom'] = DST dict['returnTo'] = "TLV" dict['cabin'] = "Economy" dict['coupons'] = "" dict['systemId'] = "24" urlT = 'http://booking.elal.co.il/newBooking/JavaScriptServlet' url1 = 'http://booking.elal.co.il/newBooking/elalInit.do?LANG=IL&systemId=24&campaignCode=04535' s = requests.session() x = "" r2 = dummy() r3 = dummy() try: rT = s.get(urlT) token = rT.text[rT.text.find("OWASP_CSRFTOKEN") + 19:rT.text.find("OWASP_CSRFTOKEN") + 58] r1 = s.get(url1, headers=headers) url2 = 'http://booking.elal.co.il/newBooking/urlDirector.do?OWASP_CSRFTOKEN=' + token r2 = s.post(url2, data=dict, headers=headers) posts = up.getPostVals() posts.feed(r2.text) dict = {} for i in posts.inputs: if 'id' in i: dict[i['id']] = i['val']
dict['journeyType'] = "1" dict['departDay'] = Start.strftime("%d") dict['departMonth'] = int(Start.strftime("%m")) - 1 dict['returnDay'] = Ret.strftime("%d") dict['returnMonth'] = int(Ret.strftime("%m")) - 1 dict['returnYear'] = Ret.strftime("%Y") dict['departureYear'] = Start.strftime("%Y") dict['lang'] = "IL" dict['returnFrom'] = DST dict['returnTo'] = "TLV" dict['cabin'] = "Economy" dict['coupons'] = "" s = requests.session() url2 = 'http://booking.elal.co.il/newBooking/urlDirector.do' #?OWASP_CSRFTOKEN='+token x = "" r3 = dummy() try: r2 = s.post(url2, data=dict) posts = up.getPostVals() posts.feed(r2.text) dict = {} for i in posts.inputs: if 'id' in i: dict[i['id']] = i['val'] url3 = 'http://fly.elal.co.il/plnext/ELALonlinebooking/Override.action' r3 = s.post(url3, data=dict) d3 = [] x = r3.text[r3.text.find("generatedJSon"):r3.text. find("\n", r3.text.find("generatedJSon"))] y = x[28:-4]
dict['departMonth']=int(Start.strftime("%m"))-1 dict['returnDay']=Ret.strftime("%d") dict['returnMonth']=int(Ret.strftime("%m"))-1 dict['returnYear']=Ret.strftime("%Y") dict['departureYear']=Start.strftime("%Y") dict['lang']="IL" dict['returnFrom']=DST dict['returnTo']="TLV" dict['cabin']="Economy" dict['coupons']="" dict['systemId']="24" urlT='http://booking.elal.co.il/newBooking/JavaScriptServlet' url1='http://booking.elal.co.il/newBooking/elalInit.do?LANG=IL&systemId=24&campaignCode=04535' s=requests.session() x="" r2=dummy() r3=dummy() try: rT=s.get(urlT) token=rT.text[rT.text.find("OWASP_CSRFTOKEN")+19:rT.text.find("OWASP_CSRFTOKEN")+58] r1=s.get(url1, headers=headers) url2='http://booking.elal.co.il/newBooking/urlDirector.do?OWASP_CSRFTOKEN='+token r2=s.post(url2,data=dict, headers=headers) posts=up.getPostVals() posts.feed(r2.text) dict={} for i in posts.inputs: if 'id' in i: dict[i['id']]=i['val'] url3='http://fly.elal.co.il/plnext/ELALspof/Override.action'