mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get Books: More fixes to the Amazon store plugin
This commit is contained in:
commit
d6377d5a45
@ -139,14 +139,26 @@ class AmazonKindleStore(StorePlugin):
|
|||||||
cover_xpath = './/div[@class="productTitle"]//img/@src'
|
cover_xpath = './/div[@class="productTitle"]//img/@src'
|
||||||
title_xpath = './/div[@class="productTitle"]/a//text()'
|
title_xpath = './/div[@class="productTitle"]/a//text()'
|
||||||
price_xpath = './/div[@class="newPrice"]/span/text()'
|
price_xpath = './/div[@class="newPrice"]/span/text()'
|
||||||
# Vertical list of books. Search "martin"
|
# Vertical list of books.
|
||||||
else:
|
else:
|
||||||
data_xpath = '//div[contains(@class, "results")]//div[contains(@class, "result")]'
|
# New style list. Search "Paolo Bacigalupi"
|
||||||
format_xpath = './/span[@class="binding"]//text()'
|
if doc.xpath('boolean(//div[@class="image"])'):
|
||||||
asin_xpath = './/div[@class="image"]/a[1]'
|
data_xpath = '//div[contains(@class, "results")]//div[contains(@class, "result")]'
|
||||||
cover_xpath = './/img[@class="productImage"]/@src'
|
format_xpath = './/span[@class="binding"]//text()'
|
||||||
title_xpath = './/a[@class="title"]/text()'
|
asin_xpath = './/div[@class="image"]/a[1]'
|
||||||
price_xpath = './/span[@class="price"]/text()'
|
cover_xpath = './/img[@class="productImage"]/@src'
|
||||||
|
title_xpath = './/a[@class="title"]/text()'
|
||||||
|
price_xpath = './/span[@class="price"]/text()'
|
||||||
|
# Old style list. Search "martin"
|
||||||
|
else:
|
||||||
|
data_xpath = '//div[contains(@class, "result")]'
|
||||||
|
format_xpath = './/span[@class="format"]//text()'
|
||||||
|
asin_xpath = './/div[@class="productImage"]/a[1]'
|
||||||
|
cover_xpath = './/div[@class="productImage"]//img/@src'
|
||||||
|
title_xpath = './/div[@class="productTitle"]/a/text()'
|
||||||
|
price_xpath = './/div[@class="newPrice"]//span//text()'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for data in doc.xpath(data_xpath):
|
for data in doc.xpath(data_xpath):
|
||||||
if counter <= 0:
|
if counter <= 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user