Subversion Repositories SmartDukaan

Rev

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

Rev 15156 Rev 15210
Line 21... Line 21...
21
            tag.replaceWith(s)
21
            tag.replaceWith(s)
22
 
22
 
23
    return soup
23
    return soup
24
 
24
 
25
class AmazonScraper:
25
class AmazonScraper:
26
    def __init__(self):
26
    def __init__(self,livePricing=None):
27
        self.count_trials = 0
27
        self.count_trials = 0
28
    
28
    
29
    def read(self, url):
29
    def read(self, url):
30
        response_data = ""
30
        response_data = ""
31
        try:
31
        try:
32
            response_data = fetchResponseUsingProxy(url)
32
            response_data = fetchResponseUsingProxy(url, self.livePricing)
33
        except Exception as e:
33
        except Exception as e:
34
            print 'ERROR: ', e
34
            print 'ERROR: ', e
35
            print 'Retrying'
35
            print 'Retrying'
36
            self.count_trials += 1
36
            self.count_trials += 1
37
            
37