This commit is contained in:
Kovid Goyal 2022-07-17 11:17:05 +05:30
commit 11b84f7c90
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -20,7 +20,7 @@ from calibre import browser as _browser, prints, random_user_agent
from calibre.utils.monotonic import monotonic from calibre.utils.monotonic import monotonic
from calibre.utils.random_ua import accept_header_for_ua from calibre.utils.random_ua import accept_header_for_ua
current_version = (1, 0, 11) current_version = (1, 0, 12)
minimum_calibre_version = (2, 80, 0) minimum_calibre_version = (2, 80, 0)
@ -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: