Subversion Repositories SmartDukaan

Rev

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

Rev 13831 Rev 13935
Line 110... Line 110...
110
                temp['sellingPriceMetric'] = float(dataMetric[1])
110
                temp['sellingPriceMetric'] = float(dataMetric[1])
111
                if not temp.has_key('shippingTime'):
111
                if not temp.has_key('shippingTime'):
112
                    print "Populating shipping time from metrics"
112
                    print "Populating shipping time from metrics"
113
                    temp['shippingTime'] = dataMetric[3]
113
                    temp['shippingTime'] = dataMetric[3]
114
                temp['sellerScore'] = int(dataMetric[4])
114
                temp['sellerScore'] = int(dataMetric[4])
-
 
115
                try:
-
 
116
                    temp['shippingFee'] = float(dataMetric[2])
-
 
117
                except:
-
 
118
                    temp['shippingFee'] = 0.0
-
 
119
                temp['sellingPrice'] = temp['sellingPrice'] + temp['shippingFee']  
115
                info.append(temp)
120
                info.append(temp)
116
        evenSeller = soup.findAll("div" , {"class" : "line seller-item even "})
121
        evenSeller = soup.findAll("div" , {"class" : "line seller-item even "})
117
        for data in evenSeller:
122
        for data in evenSeller:
118
            temp={}
123
            temp={}
119
            price = data.find('span', attrs={'class' : re.compile('pxs-final-price.*')}).string.strip('Rs.')
124
            price = data.find('span', attrs={'class' : re.compile('pxs-final-price.*')}).string.strip('Rs.')
Line 147... Line 152...
147
                temp['sellingPriceMetric'] = float(dataMetric[1])
152
                temp['sellingPriceMetric'] = float(dataMetric[1])
148
                if not temp.has_key('shippingTime'):
153
                if not temp.has_key('shippingTime'):
149
                    print "Populating shipping time from metrics"
154
                    print "Populating shipping time from metrics"
150
                    temp['shippingTime'] = dataMetric[3]
155
                    temp['shippingTime'] = dataMetric[3]
151
                temp['sellerScore'] = int(dataMetric[4])
156
                temp['sellerScore'] = int(dataMetric[4])
-
 
157
                try:
-
 
158
                    temp['shippingFee'] = float(dataMetric[2])
-
 
159
                except:
-
 
160
                    temp['shippingFee'] = 0.0
-
 
161
                temp['sellingPrice'] = temp['sellingPrice'] + temp['shippingFee']  
152
                info.append(temp)
162
                info.append(temp)
153
        print info
163
        print info
154
        print "Returning Json response from flipkart for %s" %(url)
164
        print "Returning Json response from flipkart for %s" %(url)
155
        return info
165
        return info
156
 
166