Subversion Repositories SmartDukaan

Rev

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

Rev 12208 Rev 12209
Line 703... Line 703...
703
        print "Fetched response from flipkart for %s" %(url)
703
        print "Fetched response from flipkart for %s" %(url)
704
        
704
        
705
    except urllib2.HTTPError as e:
705
    except urllib2.HTTPError as e:
706
        print 'ERROR: ', e
706
        print 'ERROR: ', e
707
        print 'Retrying'
707
        print 'Retrying'
708
        self.count_trials += 1
-
 
709
        
-
 
710
        if self.count_trials < 3:
-
 
711
            return self.read(url)
-
 
712
    
708
    
713
    self.response_data=response_data
709
    response_data=response_data
714
    page=self.response_data.decode("utf-8")
710
    page=response_data.decode("utf-8")
715
    print datetime.now()
711
    print datetime.now()
716
    soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
712
    soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
717
    page = None
713
    page = None
718
    self.response_data = None
714
    response_data = None
719
    print datetime.now()
715
    print datetime.now()
720
    print "Soup created from flipkart data for %s" %(url)
716
    print "Soup created from flipkart data for %s" %(url)
721
    info = []
717
    info = []
722
    oddSeller = soup.findAll("div" , {"class" : "line seller-item odd "})
718
    oddSeller = soup.findAll("div" , {"class" : "line seller-item odd "})
723
    for data in oddSeller:
719
    for data in oddSeller: