diff --git a/src/calibre/ebooks/metadata/sources/search_engines.py b/src/calibre/ebooks/metadata/sources/search_engines.py index 2bffa05cb8..e37bd2eb26 100644 --- a/src/calibre/ebooks/metadata/sources/search_engines.py +++ b/src/calibre/ebooks/metadata/sources/search_engines.py @@ -20,7 +20,7 @@ from calibre import browser as _browser, prints, random_user_agent from calibre.utils.monotonic import monotonic from calibre.utils.random_ua import accept_header_for_ua -current_version = (1, 0, 6) +current_version = (1, 0, 7) minimum_calibre_version = (2, 80, 0) @@ -233,13 +233,13 @@ def google_search(terms, site=None, br=None, log=prints, safe_search=False, dump ans = [] for div in root.xpath('//*[@id="search"]//*[@id="rso"]//*[@class="g"]'): try: - a = div.xpath('descendant::div[@class="rc"]//a[@href]')[0] + a = div.xpath('descendant::a[@href]')[0] except IndexError: - log('Ignoring div with no descendant') + log('Ignoring div with no main result link') continue title = tostring(a) try: - c = div.xpath('descendant::*[@role="menu"]//a[@class="fl"]')[0] + c = div.xpath('descendant::*[@role="menuitem"]//a[@class="fl"]')[0] except IndexError: log('Ignoring {!r} as it has no cached page'.format(title)) continue