def rating(self): """The rating of the product normalised to 1.0 """ for li in self.soup.find_all('li', class_='rating'): string = li.stripped_strings.next().lower() if 'overall:' not in string: continue img = li.find('img') rating = unicode(img['title']) return process_rating(rating)
def rating(self): """The rating of the product normalised to 1.0 """ for li in self.soup.find_all('li', class_='rating'): string = li.stripped_strings.next().lower() if 'overall:' not in string: continue img = li.find('img') rating = unicode(img['title']) return process_rating(rating)
def rating(self): rating_tag = self.soup.find('img', title=re.compile(r'out of \d stars')) return process_rating(rating_tag.attrs['title'])
def rating(self): rating = self.soup.find("i", class_=re.compile("review-rating")) if rating: return process_rating(rating.text)
def rating(self): rating_tag = self.soup.find('img', title=re.compile(r'out of \d stars')) return process_rating(rating_tag.attrs['title'])
def rating(self): rating = self.soup.find("i", class_=re.compile("review-rating")) if rating: return process_rating(rating.text)
def rating(self): rating_tag = self.soup.find("img", title=re.compile(r"out of \d stars")) return process_rating(rating_tag.attrs["title"])