From 7c8672f2ee343cf967a30f238c3a0fc1f41d1387 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Dec 2020 09:47:53 +0530 Subject: [PATCH] Fix google search not working because of change in website markup --- src/calibre/ebooks/metadata/sources/search_engines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/search_engines.py b/src/calibre/ebooks/metadata/sources/search_engines.py index aa8dadada2..fc932c8d42 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, 4) +current_version = (1, 0, 5) minimum_calibre_version = (2, 80, 0) @@ -235,7 +235,7 @@ 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="r"]/a[@href]')[0] + a = div.xpath('descendant::div[@class="rc"]//a[@href]')[0] except IndexError: log('Ignoring div with no descendant') continue