Subversion Repositories SmartDukaan

Rev

Rev 14459 | Rev 14473 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14459 Rev 14463
Line 256... Line 256...
256
                sections.pop(0)
256
                sections.pop(0)
257
                sections.pop(0)
257
                sections.pop(0)
258
                
258
                
259
                subOrders = sections
259
                subOrders = sections
260
                bulk = self.db.merchantOrder.initialize_ordered_bulk_op()
260
                bulk = self.db.merchantOrder.initialize_ordered_bulk_op()
-
 
261
                closed = True
261
                for subOrderElement in subOrders:
262
                for subOrderElement in subOrders:
262
                    closed = True
-
 
263
                    divs = subOrderElement.findAll("div", {"class": "blk lrPad subordrs"})
263
                    div1 = subOrderElement.findAll("div", {"class": "blk lrPad subordrs"})
264
                    if len(divs)<=0:
264
                    if len(div1)<=0:
265
                        raise ParseException("subOrder", "Could not Parse suborders for Snapdeal")
265
                        raise ParseException("subOrder", "Could not Parse suborders for Snapdeal")
266
                    subOrder = None
266
                    subOrder = None
267
                    breakFlag = False
267
                    breakFlag = False
-
 
268
                    for strDiv in str(div1).split("<div class=\"seperator\"></div>"):
268
                    for div in divs:
269
                        div = BeautifulSoup(strDiv)
269
                        divStr = str(div)
270
                        divStr = str(div)
270
                        divStr = divStr.replace("\n","").replace("\t", "")
271
                        divStr = divStr.replace("\n","").replace("\t", "")
271
                        updateMap = {}
272
                        updateMap = {}
272
                        for line in divStr.split("<br />"):
273
                        for line in divStr.split("<br />"):
273
                            if "Suborder ID" in line:
274
                            if "Suborder ID" in line:
Line 406... Line 407...
406
    #print todict([1,2,"3"])
407
    #print todict([1,2,"3"])
407
    store = getStore(3)
408
    store = getStore(3)
408
    #store.scrapeStoreOrders()
409
    #store.scrapeStoreOrders()
409
    #store._isSubOrderActive(8, "5970688907")
410
    #store._isSubOrderActive(8, "5970688907")
410
    #store.scrapeAffiliate()
411
    #store.scrapeAffiliate()
411
    store.parseOrderRawHtml(123456, "subtagId111", 1223231,  "html", 'https://m.snapdeal.com/purchaseMobileComplete?order=5308508434&code=264703b619f8f08f1e1ce7dc42188708')
412
    store.scrapeStoreOrders()
412
 
413
 
413
 
414
 
414
            
415
            
415
def todict(obj, classkey=None):
416
def todict(obj, classkey=None):
416
    if isinstance(obj, dict):
417
    if isinstance(obj, dict):