From 1ce331c2aa4bcecbae7996a736161e7c92db86ae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Nov 2011 20:11:30 +0530 Subject: [PATCH] Amazon metadata download: Workaround for change in Amazon website causing some books to have incorrect ratings downloaded --- src/calibre/ebooks/metadata/sources/amazon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index a799271ee8..819cd674fc 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -341,11 +341,11 @@ class Worker(Thread): # Get details {{{ return authors def parse_rating(self, root): - ratings = root.xpath('//div[@class="jumpBar"]/descendant::span[@class="asinReviewsSummary"]') + ratings = root.xpath('//div[@class="jumpBar"]/descendant::span[contains(@class,"asinReviewsSummary")]') if not ratings: - ratings = root.xpath('//div[@class="buying"]/descendant::span[@class="asinReviewsSummary"]') + ratings = root.xpath('//div[@class="buying"]/descendant::span[contains(@class,"asinReviewsSummary")]') if not ratings: - ratings = root.xpath('//span[@class="crAvgStars"]/descendant::span[@class="asinReviewsSummary"]') + ratings = root.xpath('//span[@class="crAvgStars"]/descendant::span[contains(@class,"asinReviewsSummary")]') if ratings: for elem in ratings[0].xpath('descendant::*[@title]'): t = elem.get('title').strip()