From e8be35ab44e6d9f1ed270009a7a7d7cdd8c86f43 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 27 Aug 2011 16:10:28 -0400 Subject: [PATCH] Store: Fix BeWrite plugin. --- src/calibre/gui2/store/stores/bewrite_plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/store/stores/bewrite_plugin.py b/src/calibre/gui2/store/stores/bewrite_plugin.py index bfd543db49..b702f15623 100644 --- a/src/calibre/gui2/store/stores/bewrite_plugin.py +++ b/src/calibre/gui2/store/stores/bewrite_plugin.py @@ -80,10 +80,13 @@ class BeWriteStore(BasicStoreConfig, StorePlugin): price = '$' + price.split('$')[-1] search_result.price = price.strip() - cover_img = idata.xpath('//div[@id="content"]//img[1]/@src') + cover_img = idata.xpath('//div[@id="content"]//img/@src') if cover_img: - cover_url = 'http://www.bewrite.net/mm5/' + cover_img[0] - search_result.cover_url = cover_url.strip() + for i in cover_img: + if '00001' in i: + cover_url = 'http://www.bewrite.net/mm5/' + i + search_result.cover_url = cover_url.strip() + break formats = set([]) if idata.xpath('boolean(//div[@id="content"]//td[contains(text(), "ePub")])'):