| Line 763... |
Line 763... |
| 763 |
# print "No summary for", userId
|
763 |
# print "No summary for", userId
|
| 764 |
# else:
|
764 |
# else:
|
| 765 |
# print userId, directory+summaryFile
|
765 |
# print userId, directory+summaryFile
|
| 766 |
# store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
766 |
# store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
| 767 |
#"storeId":1, "status":"parse_failed", "subOrders":{"$exists":False}
|
767 |
#"storeId":1, "status":"parse_failed", "subOrders":{"$exists":False}
|
| 768 |
for order in store.db.merchantOrder.find({"subOrders":{"$exists":True}, "subOrders.trackingUrl":{"$exists":False}}):
|
768 |
for order in store.db.merchantOrder.find({"status":"parse_failed"}):
|
| 769 |
try:
|
769 |
try:
|
| 770 |
orderId=order.get("orderId")
|
770 |
orderId=order.get("orderId")
|
| 771 |
o = session.query(OrdersRaw).filter_by(id = orderId).one()
|
771 |
o = session.query(OrdersRaw).filter_by(id = orderId).one()
|
| - |
|
772 |
o.order_url = order['orderTrackingUrl']
|
| - |
|
773 |
session.commit()
|
| 772 |
store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, order['orderTrackingUrl'])
|
774 |
store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, order['orderTrackingUrl'])
|
| 773 |
except:
|
775 |
except:
|
| 774 |
print "Could not parse", orderId
|
776 |
print "Could not parse", orderId
|
| 775 |
finally:
|
777 |
finally:
|
| 776 |
session.close()
|
778 |
session.close()
|