mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Get books: Fix amazon plugin for change to amazon results page markup
This commit is contained in:
parent
0167613cdb
commit
e0e20c7872
@ -69,7 +69,7 @@ def search_amazon(query, max_results=10, timeout=60,
|
||||
continue
|
||||
|
||||
cover_url = ''.join(result.xpath('.//img/@src'))
|
||||
title = etree.tostring(result.xpath('.//h5')[0], method='text', encoding='unicode')
|
||||
title = etree.tostring(result.xpath('.//h2')[0], method='text', encoding='unicode')
|
||||
adiv = result.xpath('.//div[contains(@class, "a-color-secondary")]')[0]
|
||||
aparts = etree.tostring(adiv, method='text', encoding='unicode').split()
|
||||
idx = aparts.index('|')
|
||||
@ -120,5 +120,6 @@ class AmazonKindleStore(StorePlugin):
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
for result in search_amazon(' '.join(sys.argv[1:]), write_html_to='/t/amazon.html'):
|
||||
print(result)
|
||||
|
Loading…
x
Reference in New Issue
Block a user