| Line 86... |
Line 86... |
| 86 |
traceback.print_exc()
|
86 |
traceback.print_exc()
|
| 87 |
self.parseCancelled(merchantOrder, soup)
|
87 |
self.parseCancelled(merchantOrder, soup)
|
| 88 |
resp['result'] = 'ORDER_CREATED'
|
88 |
resp['result'] = 'ORDER_CREATED'
|
| 89 |
return resp
|
89 |
return resp
|
| 90 |
except:
|
90 |
except:
|
| 91 |
order = self.db.merchantOrder.findOne({"orderId":orderId})
|
91 |
order = self.db.merchantOrder.find_one({"orderId":orderId})
|
| 92 |
if order is not None:
|
92 |
if order is not None:
|
| 93 |
self.db.merchantOrder.update({"orderId":orderId}, {"$set":{"status":"parse_failed"}})
|
93 |
self.db.merchantOrder.update({"orderId":orderId}, {"$set":{"status":"parse_failed"}})
|
| 94 |
print "Error occurred"
|
94 |
print "Error occurred"
|
| 95 |
traceback.print_exc()
|
95 |
traceback.print_exc()
|
| 96 |
resp['result'] = 'ORDER_NOT_CREATED'
|
96 |
resp['result'] = 'ORDER_NOT_CREATED'
|
| Line 493... |
Line 493... |
| 493 |
# ('Accept', 'text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8'),
|
493 |
# ('Accept', 'text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8'),
|
| 494 |
# ('Accept-Encoding', 'gzip,deflate,sdch'),
|
494 |
# ('Accept-Encoding', 'gzip,deflate,sdch'),
|
| 495 |
# ('Accept-Language', 'en-US,en;q=0.8'),
|
495 |
# ('Accept-Language', 'en-US,en;q=0.8'),
|
| 496 |
# ('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.3')]
|
496 |
# ('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.3')]
|
| 497 |
# store.scrapeStoreOrders()
|
497 |
# store.scrapeStoreOrders()
|
| 498 |
#store.parseOrderRawHtml(2121, "13232", 14, readSSh("/home/amit/917.html"), "https://www.amazon.in/gp/bOy/spc/handlers/static-submit-decoupled.html/ref=ox_spc_place_order?ie=UTF8&hasWorkingJavascript=")
|
498 |
store.parseOrderRawHtml(2121, "13232", 14, readSSh("/home/amit/917.html"), "https://www.amazon.in/gp/bOy/spc/handlers/static-submit-decoupled.html/ref=ox_spc_place_order?ie=UTF8&hasWorkingJavascript=")
|
| 499 |
readSSh("/tmp/User211/2015-04-01 15:31:42.250309")
|
499 |
#readSSh("/tmp/User211/2015-04-01 15:31:42.250309")
|
| 500 |
store.scrapeAffiliate()
|
500 |
#store.scrapeAffiliate()
|
| 501 |
def readSSh(fileName):
|
501 |
def readSSh(fileName):
|
| 502 |
try:
|
502 |
try:
|
| 503 |
str1 = open(fileName).read()
|
503 |
str1 = open(fileName).read()
|
| 504 |
return str1
|
504 |
return str1
|
| 505 |
except:
|
505 |
except:
|