Subversion Repositories SmartDukaan

Rev

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

Rev 15187 Rev 15213
Line 65... Line 65...
65
            try:
65
            try:
66
                if data['dealFlag'] ==1 and data['dealType'] ==1:
66
                if data['dealFlag'] ==1 and data['dealType'] ==1:
67
                    print "Inside deal"
67
                    print "Inside deal"
68
                    deal_url = "http://www.amazon.in/dp/%s"%(data['identifier'].strip())
68
                    deal_url = "http://www.amazon.in/dp/%s"%(data['identifier'].strip())
69
                    print deal_url
69
                    print deal_url
70
                    dealScraperAmazon = AmazonDealScraper.AmazonScraper()
70
                    dealScraperAmazon = AmazonDealScraper.AmazonScraper(True)
71
                    lowestPrice = dealScraperAmazon.read(deal_url)
71
                    lowestPrice = dealScraperAmazon.read(deal_url)
72
                    print lowestPrice
72
                    print lowestPrice
73
                    if lowestPrice == 0:
73
                    if lowestPrice == 0:
74
                        raise
74
                        raise
75
                else:    
75
                else:    
76
                    scraperAmazon = AmazonScraper()
76
                    scraperAmazon = AmazonScraper(True)
77
                    lowestPrice = scraperAmazon.read(url)
77
                    lowestPrice = scraperAmazon.read(url)
78
            except Exception as e:
78
            except Exception as e:
79
                print e
79
                print e
80
                scraperAmazon = AmazonScraper()
80
                scraperAmazon = AmazonScraper(True)
81
                lowestPrice = scraperAmazon.read(url)
81
                lowestPrice = scraperAmazon.read(url)
82
            print "LowestPrice ",lowestPrice
82
            print "LowestPrice ",lowestPrice
83
            inStock = 0
83
            inStock = 0
84
            if lowestPrice > 0:
84
            if lowestPrice > 0:
85
                inStock = 1
85
                inStock = 1