mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Replace Direct Xpath for Google Search
This commit is contained in:
parent
29ab970bad
commit
dbae03e890
@ -252,7 +252,7 @@ def google_parse_results(root, raw, log=prints):
|
|||||||
cache_url_map = google_extract_cache_urls(raw)
|
cache_url_map = google_extract_cache_urls(raw)
|
||||||
# print('\n'.join(cache_url_map))
|
# print('\n'.join(cache_url_map))
|
||||||
ans = []
|
ans = []
|
||||||
for div in root.xpath('//*[@id="search"]//*[@id="rso"]//*[@class="kWxLod" or @class="hlcw0c"]'):
|
for div in root.xpath('//*[@id="search"]//*[@id="rso"]//div[descendant::h3]'):
|
||||||
try:
|
try:
|
||||||
a = div.xpath('descendant::a[@href]')[0]
|
a = div.xpath('descendant::a[@href]')[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user