Subversion Repositories SmartDukaan

Rev

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

Rev 12286 Rev 12287
Line 117... Line 117...
117
                    ourOfferPrice = vendor['sellingPrice']
117
                    ourOfferPrice = vendor['sellingPrice']
118
                iterator+=1
118
                iterator+=1
119
        except:
119
        except:
120
            continue
120
            continue
121
        finally:
121
        finally:
122
            sdItem, snapdealItem =None, None
122
            sdItem =None
123
        snapdealItem.ourSnapdealPrice = ourSp
123
        snapdealItem.ourSnapdealPrice = ourSp
124
        snapdealItem.ourSnapdealOfferPrice = ourOfferPrice
124
        snapdealItem.ourSnapdealOfferPrice = ourOfferPrice
125
        snapdealItem.ourSnapdealInventory = ourInventory
125
        snapdealItem.ourSnapdealInventory = ourInventory
126
        snapdealItem.lowestSnapdealPrice = lowestSp
126
        snapdealItem.lowestSnapdealPrice = lowestSp
127
        snapdealItem.lowestSnapdealOfferPrice = lowestOfferPrice
127
        snapdealItem.lowestSnapdealOfferPrice = lowestOfferPrice
Line 151... Line 151...
151
 
151
 
152
                iterator+=1
152
                iterator+=1
153
        except:
153
        except:
154
            continue
154
            continue
155
        finally:
155
        finally:
156
            fkItem, flipkartItem=None,None
156
            fkItem=None
157
        try:
157
        try:
158
            request_url = "https://api.flipkart.net/sellers/skus/%s/listings"%(str(fkItem.flipkartSerialNumber))
158
            request_url = "https://api.flipkart.net/sellers/skus/%s/listings"%(str(fkItem.flipkartSerialNumber))
159
            r = httpRequest.get(request_url, auth=('m2z93iskuj81qiid', '0c7ab6a5-98c0-4cdc-8be3-72c591e0add4'))
159
            r = httpRequest.get(request_url, auth=('m2z93iskuj81qiid', '0c7ab6a5-98c0-4cdc-8be3-72c591e0add4'))
160
            print "Inventory info",r.json()
160
            print "Inventory info",r.json()
161
            stock_count = int((r.json()['attributeValues'])['stock_count'])
161
            stock_count = int((r.json()['attributeValues'])['stock_count'])
Line 210... Line 210...
210
 
210
 
211
        except Exception as e:
211
        except Exception as e:
212
            print e
212
            print e
213
            print "Unable to fetch details from Amazon Listing page for ",amazonItem.item_id
213
            print "Unable to fetch details from Amazon Listing page for ",amazonItem.item_id
214
            continue
214
            continue
215
        finally:
-
 
216
            amazonItem = None
-
 
217
    sc =None
215
    sc =None
218
    scraperAmazon = None
216
    scraperAmazon = None
219
        
217
        
220
def getBrowserObject():
218
def getBrowserObject():
221
        br = mechanize.Browser(factory=mechanize.RobustFactory())
219
        br = mechanize.Browser(factory=mechanize.RobustFactory())