Subversion Repositories SmartDukaan

Rev

Rev 18326 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18326 Rev 18327
Line 25... Line 25...
25
        print url
25
        print url
26
        try:
26
        try:
27
            
27
            
28
            """quick fix,need to add it conf""" 
28
            """quick fix,need to add it conf""" 
29
            
29
            
30
            response_data = fetchResponseUsingProxy(url, headers, livePricing=None, proxy=True, flipkart=False)      
30
            response_data = fetchResponseUsingProxy(url, headers, livePricing=None, proxy=True, flipkart=False)
31
            print "Fetched response from flipkart for %s" %(url)
31
            print "Fetched response from flipkart for %s" %(url)
32
            #redirect_url = response.url
32
            #redirect_url = response.url
33
 
33
 
34
        except Exception as e:
34
        except Exception as e:
35
            traceback.print_exc()
35
            traceback.print_exc()
Line 52... Line 52...
52
        try:
52
        try:
53
            for priceMap in  input_json['RESPONSE']['productInfo'][self.fsn]['priceWidget']['prices']:
53
            for priceMap in  input_json['RESPONSE']['productInfo'][self.fsn]['priceWidget']['prices']:
54
                if priceMap['isFinal']:
54
                if priceMap['isFinal']:
55
                    buyBoxPrice =  float(priceMap['price'])
55
                    buyBoxPrice =  float(priceMap['price'])
56
        except:
56
        except:
-
 
57
            print "Exception in %s "%(self.fsn)
57
            traceback.print_exc()
58
            traceback.print_exc()
58
        for x in (input_json['RESPONSE']['productInfo'][self.fsn]['marketplace']):
59
        for x in (input_json['RESPONSE']['productInfo'][self.fsn]['marketplace']):
59
#             print x['marketplace.listId'],
60
#             print x['marketplace.listId'],
60
#             print '\t',
61
#             print '\t',
61
#             print x['product.availabilityDetails']['product.isOOS'],
62
#             print x['product.availabilityDetails']['product.isOOS'],
Line 79... Line 80...
79
            
80
            
80
 
81
 
81
def main():
82
def main():
82
    print datetime.datetime.now()
83
    print datetime.datetime.now()
83
    scraper = FlipkartProductPageScraper()
84
    scraper = FlipkartProductPageScraper()
84
    print scraper.read('MOBE5PFFKF8Y3CZP')
85
    print scraper.read('TABE2FNWDAXHEQTA')
85
    print datetime.datetime.now()
86
    print datetime.datetime.now()
86
 
87
 
87
 
88
 
88
if __name__ == '__main__':
89
if __name__ == '__main__':
89
    main()
90
    main()
90
91