summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-04-12 17:34:21 +0200
committerGitHub <noreply@github.com>2021-04-12 17:34:21 +0200
commit01cefffbf6efa8a027e0e7d720970fffadb6337a (patch)
treea4c37f7b73897c7635ee5fab01c1e8e967e23d8a /searx/engines/google.py
parent6c0114567e7ba1b3f4a54327eddf658b7474ca58 (diff)
parentd14994dc73ba5c95382812581dac146d9eceaafa (diff)
Merge pull request #1 from metasearch-lab/httpx_networks
Httpx networks
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py5
1 files changed, 2 insertions, 3 deletions
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()