mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'search_engine_google_1750692' of https://github.com/cgaspar/calibre
Fixes #1750692 [Amazon metadata plugin error](https://bugs.launchpad.net/calibre/+bug/1750692)
This commit is contained in:
commit
0fbb1a3e58
@ -230,7 +230,11 @@ def google_search(terms, site=None, br=None, log=prints, safe_search=False, dump
|
||||
root = query(br, url, 'google', dump_raw, timeout=timeout)
|
||||
ans = []
|
||||
for div in root.xpath('//*[@id="search"]//*[@id="rso"]//*[@class="g"]'):
|
||||
try:
|
||||
a = div.xpath('descendant::h3[@class="r"]/a[@href]')[0]
|
||||
except IndexError:
|
||||
log('Ignoring div with no descendant')
|
||||
continue
|
||||
title = tostring(a)
|
||||
try:
|
||||
c = div.xpath('descendant::div[@class="s"]//a[@class="fl"]')[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user