mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix detection of authors for amazon results
Now handles authors that are not linked as well
This commit is contained in:
parent
b20dbb3c06
commit
dedd6c84aa
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
store_version = 6 # Needed for dynamic plugin loading
|
store_version = 7 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
@ -47,9 +47,7 @@ def search_amazon(query, max_results=10, timeout=60,
|
|||||||
asin_xpath = '@data-asin'
|
asin_xpath = '@data-asin'
|
||||||
cover_xpath = CSSSelect('img.s-access-image') + '/@src'
|
cover_xpath = CSSSelect('img.s-access-image') + '/@src'
|
||||||
title_xpath = CSSSelect('h2.s-access-title') + '//text()'
|
title_xpath = CSSSelect('h2.s-access-title') + '//text()'
|
||||||
author_xpath = ('.//a[not(@title) and starts-with(@href, "/") and'
|
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
|
||||||
' contains(@class, "a-link-normal") and'
|
|
||||||
' contains(@href, "ref=sr_ntt_srch_lnk")]//text()')
|
|
||||||
price_xpath = '(.//span[contains(@class, " s-price ")])[last()]//text()'
|
price_xpath = '(.//span[contains(@class, " s-price ")])[last()]//text()'
|
||||||
elif 'grid' in results.get('class', ''):
|
elif 'grid' in results.get('class', ''):
|
||||||
data_xpath = '//div[contains(@class, "prod")]'
|
data_xpath = '//div[contains(@class, "prod")]'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user