diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2022-01-07 11:18:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-07 11:18:47 +0100 |
| commit | ced656606fbc7a5d5dda8b1e4efe16a9eb88e57b (patch) | |
| tree | b80b70125aa3272b386f493841c150c6495c1cd0 /searx/engines | |
| parent | e12525a1fabef37dbaf5e75bc143787ba626b43f (diff) | |
| parent | 5dd3442f83debe73a6e7302e620e464b1982c369 (diff) | |
Merge pull request #709 from return42/drop-etools
[fix] drop etools engine module
Diffstat (limited to 'searx/engines')
| -rw-r--r-- | searx/engines/etools.py | 58 |
1 files changed, 0 insertions, 58 deletions
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 |