From 5dd3442f83debe73a6e7302e620e464b1982c369 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 6 Jan 2022 14:42:28 +0100 Subject: [PATCH] [fix] drop etools engine module The implementation of the etools engine is poor. No date-range support, no language support and it is broken by a CAPTCHA. etools is a metasearch engine, the major search engines it supports (google, bing, wikipedia, Yahoo) are already available in SeaarXNG. While etools does support several engines we currently don't support directly, support for them should be added directly to SearXNG if there is demand. In practice: in SearXNG the worse etools results will be mixed with good results from other engines we have (as long as there is no captcha). At best case, what we win with etools is in e.g. results from de.ask.com in a query from a german request .. in all other cases worse results are bubble up in SearXNG's result list. [1] https://github.com/searxng/searxng/issues/696#issuecomment-1005855499 Closes: https://github.com/searxng/searxng/issues/696 Signed-off-by: Markus Heiser --- searx/engines/etools.py | 58 ----------------------------------------- searx/settings.yml | 7 ----- 2 files changed, 65 deletions(-) delete mode 100644 searx/engines/etools.py diff --git a/searx/engines/etools.py b/searx/engines/etools.py deleted file mode 100644 index 08bc63cd8..000000000 --- a/searx/engines/etools.py +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" - eTools (Web) -""" - -from lxml import html -from urllib.parse import quote -from searx.utils import extract_text, eval_xpath - -# about -about = { - "website": 'https://www.etools.ch', - "wikidata_id": None, - "official_api_documentation": None, - "use_official_api": False, - "require_api_key": False, - "results": 'HTML', -} - -categories = ['general', 'web'] -paging = False -safesearch = True - -base_url = 'https://www.etools.ch' -search_path = ( - # fmt: off - '/searchAdvancedSubmit.do' - '?query={search_term}' - '&pageResults=20' - '&safeSearch={safesearch}' - # fmt: on -) - - -def request(query, params): - if params['safesearch']: - safesearch = 'true' - else: - safesearch = 'false' - - params['url'] = base_url + search_path.format(search_term=quote(query), safesearch=safesearch) - - return params - - -def response(resp): - results = [] - - dom = html.fromstring(resp.text) - - for result in eval_xpath(dom, '//table[@class="result"]//td[@class="record"]'): - url = eval_xpath(result, './a/@href')[0] - title = extract_text(eval_xpath(result, './a//text()')) - content = extract_text(eval_xpath(result, './/div[@class="text"]//text()')) - - results.append({'url': url, 'title': title, 'content': content}) - - return results diff --git a/searx/settings.yml b/searx/settings.yml index f1d6fa1b1..3b4b0e3b4 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -479,13 +479,6 @@ engines: timeout: 3.0 disabled: true - - name: etools - engine: etools - shortcut: eto - disabled: true - additional_tests: - rosebud: *test_rosebud - - name: etymonline engine: xpath paging: true