mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Fix Google Books.
This commit is contained in:
parent
5538e0ebdf
commit
9dbeb3c877
@ -59,7 +59,7 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
counter = max_results
|
counter = max_results
|
||||||
with closing(br.open(url, timeout=timeout)) as f:
|
with closing(br.open(url, timeout=timeout)) as f:
|
||||||
doc = html.fromstring(f.read())
|
doc = html.fromstring(f.read())
|
||||||
for data in doc.xpath('//ol[@id="rso"]/li'):
|
for data in doc.xpath('//ol/li'):
|
||||||
if counter <= 0:
|
if counter <= 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//h3/a//text()'))
|
title = ''.join(data.xpath('.//h3/a//text()'))
|
||||||
authors = data.xpath('.//div[@class="f"]//a//text()')
|
authors = data.xpath('.//span[contains(@class, "f")]//a//text()')
|
||||||
while authors and authors[-1].strip().lower() in ('preview', 'read', 'more editions'):
|
while authors and authors[-1].strip().lower() in ('preview', 'read', 'more editions'):
|
||||||
authors = authors[:-1]
|
authors = authors[:-1]
|
||||||
if not authors:
|
if not authors:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user