| Line 388... |
Line 388... |
| 388 |
try:
|
388 |
try:
|
| 389 |
supcElement = pq(supcElement)
|
389 |
supcElement = pq(supcElement)
|
| 390 |
title = supcElement('div.order-heading').text().strip()
|
390 |
title = supcElement('div.order-heading').text().strip()
|
| 391 |
productUrl = supcElement.attr("data-href")
|
391 |
productUrl = supcElement.attr("data-href")
|
| 392 |
imgUrl = supcElement.find('img').attr('src')
|
392 |
imgUrl = supcElement.find('img').attr('src')
|
| - |
|
393 |
try:
|
| - |
|
394 |
supc = self.catalogdb.MasterData.find_one({"secondaryIdentifier":productUrl.split("/")[-1], "source_id":self.store_id})
|
| - |
|
395 |
if supc is None:
|
| - |
|
396 |
raise
|
| - |
|
397 |
except:
|
| 393 |
supc = imgUrl.split('-')[-3]
|
398 |
supc = imgUrl.split('-')[-3]
|
| 394 |
supcMap[supc] = {'title':title, 'imgUrl':imgUrl, 'productUrl':productUrl}
|
399 |
supcMap[supc] = {'title':title, 'imgUrl':imgUrl, 'productUrl':productUrl}
|
| 395 |
except:
|
400 |
except:
|
| 396 |
pass
|
401 |
pass
|
| 397 |
return json.loads(jsonValue)
|
402 |
return json.loads(jsonValue)
|
| 398 |
|
403 |
|
| Line 911... |
Line 916... |
| 911 |
|
916 |
|
| 912 |
|
917 |
|
| 913 |
def main():
|
918 |
def main():
|
| 914 |
#print todict([1,2,"3"])
|
919 |
#print todict([1,2,"3"])
|
| 915 |
store = getStore(3)
|
920 |
store = getStore(3)
|
| 916 |
store.parseOrderRawHtml(332221, "3232311", 2, readSSh("/home/amit/65185.html"), " https://m.snapdeal.com/purchaseMobileComplete?code=a8b3420d4c5bc248ea887df6c9b3a724&order=10478372453")
|
921 |
store.parseOrderRawHtml(332221, "3232311", 2, readSSh("/home/amit/sample1.html"), " https://m.snapdeal.com/purchaseMobileComplete?code=a8b3420d4c5bc248ea887df6c9b3a724&order=10478372453")
|
| 917 |
#store.scrapeAffiliate()
|
922 |
#store.scrapeAffiliate()
|
| 918 |
#https://m.snapdeal.com/purchaseMobileComplete?code=3fbc8a02a1c4d3c4e906f46886de0464&order=5808451506
|
923 |
#https://m.snapdeal.com/purchaseMobileComplete?code=3fbc8a02a1c4d3c4e906f46886de0464&order=5808451506
|
| 919 |
#https://m.snapdeal.com/purchaseMobileComplete?code=9f4dfa49ff08a16d04c5e4bf519506fc&order=9611672826
|
924 |
#https://m.snapdeal.com/purchaseMobileComplete?code=9f4dfa49ff08a16d04c5e4bf519506fc&order=9611672826
|
| 920 |
|
925 |
|
| 921 |
# orders = list(session.query(OrdersRaw).filter_by(store_id=3).filter_by(status='ORDER_NOT_CREATED').all())
|
926 |
# orders = list(session.query(OrdersRaw).filter_by(store_id=3).filter_by(status='ORDER_NOT_CREATED').all())
|