Subversion Repositories SmartDukaan

Rev

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

Rev 12396 Rev 12402
Line 55... Line 55...
55
                unitCost = float(price.replace("Rs.","").replace(",",""))
55
                unitCost = float(price.replace("Rs.","").replace(",",""))
56
                shippingCost = data.find('p', attrs={'class' : re.compile('.*olpShippingInfo*')}).find('span').text
56
                shippingCost = data.find('p', attrs={'class' : re.compile('.*olpShippingInfo*')}).find('span').text
57
                if "FREE" in shippingCost:
57
                if "FREE" in shippingCost:
58
                    shippingCost = 0
58
                    shippingCost = 0
59
                else:
59
                else:
60
                    print "shippingCost= ",float(shippingCost.replace("+Rs.","").replace("Delivery",""))
60
                    #print "shippingCost= ",float(shippingCost.replace("+Rs.","").replace("Delivery",""))
61
                    shippingCost = float(shippingCost.replace("+Rs.","").replace("Delivery",""))
61
                    shippingCost = float(shippingCost.replace("+Rs.","").replace("Delivery",""))
62
                
62
                
63
                sellerColumn =  data.find('p', attrs={'class' : re.compile('.*olpSellerName*')})
63
                sellerColumn =  data.find('p', attrs={'class' : re.compile('.*olpSellerName*')})
64
                store=""
64
                store=""
65
                storeUrl=""
65
                storeUrl=""
Line 103... Line 103...
103
            return returnMap
103
            return returnMap
104
    
104
    
105
    def findStoreFront(self,returnMap):
105
    def findStoreFront(self,returnMap):
106
        storeFront={}
106
        storeFront={}
107
        for arr in returnMap.itervalues():
107
        for arr in returnMap.itervalues():
108
            print "arr is ",arr
-
 
109
            for dic in arr:
108
            for dic in arr:
110
                print "dic ",dic
-
 
111
                if dic['isStoreFront']!='True':
109
                if dic['isStoreFront']!='True':
112
                    storeFront[dic.get('storeUrl')] =''
110
                    storeFront[dic.get('storeUrl')] =''
113
        rs = (grequests.get(u,stream=False) for u in storeFront.keys())
111
        rs = (grequests.get(u,stream=False) for u in storeFront.keys())
114
        for x in grequests.map(rs):
112
        for x in grequests.map(rs):
115
            soup = strip_tags(x.text,invalid_tags)
113
            soup = strip_tags(x.text,invalid_tags)