From eaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Thu, 18 Mar 2021 19:59:01 +0100 Subject: [enh] replace requests by httpx --- searx/engines/google.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'searx/engines/google.py') diff --git a/searx/engines/google.py b/searx/engines/google.py index 8c20029a3..dcb65df57 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -10,7 +10,7 @@ Definitions`_. # pylint: disable=invalid-name, missing-function-docstring -from urllib.parse import urlencode, urlparse +from urllib.parse import urlencode from lxml import html from searx import logger from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex @@ -186,8 +186,7 @@ def get_lang_info(params, lang_list, custom_aliases): return ret_val def detect_google_sorry(resp): - resp_url = urlparse(resp.url) - if resp_url.netloc == 'sorry.google.com' or resp_url.path.startswith('/sorry'): + if resp.url.host == 'sorry.google.com' or resp.url.path.startswith('/sorry'): raise SearxEngineCaptchaException() -- cgit v1.2.3