| Line 64... |
Line 64... |
| 64 |
merchantOrderId = doc("#orders-list>div>span>b").html()
|
64 |
merchantOrderId = doc("#orders-list>div>span>b").html()
|
| 65 |
if not merchantOrderId:
|
65 |
if not merchantOrderId:
|
| 66 |
merchantOrderId = urlparse.parse_qs(urlparse.urlsplit(orderSuccessUrl).query)
|
66 |
merchantOrderId = urlparse.parse_qs(urlparse.urlsplit(orderSuccessUrl).query)
|
| 67 |
else:
|
67 |
else:
|
| 68 |
raise
|
68 |
raise
|
| 69 |
if not merchantOrderId or re.match("\d+-\d+\d+", merchantOrderId):
|
69 |
if not merchantOrderId or not re.match("\d+-\d+-\d+", merchantOrderId):
|
| 70 |
raise
|
70 |
raise
|
| 71 |
order = Order(orderId, userId, subTagId, self.store_id, orderSuccessUrl, True)
|
71 |
order = Order(orderId, userId, subTagId, self.store_id, orderSuccessUrl, True)
|
| 72 |
order.orderTrackingUrl = ORDER_REDIRECT_URL % (merchantOrderId)
|
72 |
order.orderTrackingUrl = ORDER_REDIRECT_URL % (merchantOrderId)
|
| 73 |
order.orderSuccessUrl = orderSuccessUrl
|
73 |
order.orderSuccessUrl = orderSuccessUrl
|
| 74 |
order.merchantOrderId = merchantOrderId
|
74 |
order.merchantOrderId = merchantOrderId
|
| Line 975... |
Line 975... |
| 975 |
session.commit()
|
975 |
session.commit()
|
| 976 |
finally:
|
976 |
finally:
|
| 977 |
session.close()
|
977 |
session.close()
|
| 978 |
|
978 |
|
| 979 |
if __name__ == '__main__':
|
979 |
if __name__ == '__main__':
|
| 980 |
# readSSh("/AmazonTrack/User2942/402-2467356-7564367")
|
980 |
#readSSh("~/AmazonTrack/User18053/orderSummary07-01:00:33:08")
|
| 981 |
# readSSh("/AmazonTrack/User10466/orderSummary18-11:21:32:36")
|
981 |
# readSSh("/AmazonTrack/User10466/orderSummary18-11:21:32:36")
|
| 982 |
# readSSh("/AmazonTrack/User5525/171-0333104-6169933")
|
982 |
# readSSh("/AmazonTrack/User5525/171-0333104-6169933")
|
| 983 |
main()
|
983 |
#main()
|
| 984 |
#store=getStore(1)
|
984 |
store=getStore(1)
|
| 985 |
#store.trackOrdersForUser(5525, "https://www.amazon.in/gp/css/summary/edit.html?orderID=171-0333104-6169933", readSSh("/AmazonTrack/User5525/171-0333104-6169933"))
|
985 |
store.parseOrderRawHtml(99999, 'd', 14, readSSh('/home/amit/sample.html'), 'https://www.amazon.in/gp/buy/thankyou/handlers/display.html?ie=UTF8&asins=B01DDP7D6W&orderId=406-9807873-3094728&purchaseId=404-46')
|