summaryrefslogtreecommitdiff
path: root/searx/engines/gentoo.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-12-30 18:28:02 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2023-03-24 10:37:42 +0100
commit4d4aa13e1f1d254e5d57c67973a7809d9c1e21f9 (patch)
tree1d3399dd2c7bb8475fac92c08681abb5096e9e1e /searx/engines/gentoo.py
parent96a2eec3b5e20afda89d9e3a81b09ca1612dc186 (diff)
downloadsearxng-4d4aa13e1f1d254e5d57c67973a7809d9c1e21f9.tar.gz
searxng-4d4aa13e1f1d254e5d57c67973a7809d9c1e21f9.zip
[mod] remove obsolete EngineTraits.supported_languages
All engines has been migrated from ``supported_languages`` to the ``fetch_traits`` concept. There is no longer a need for the obsolete code that implements the ``supported_languages`` concept. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/gentoo.py')
-rw-r--r--searx/engines/gentoo.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/gentoo.py b/searx/engines/gentoo.py
index 856c93710..f0cb6a794 100644
--- a/searx/engines/gentoo.py
+++ b/searx/engines/gentoo.py
@@ -25,6 +25,7 @@ base_url = 'https://wiki.gentoo.org'
# xpath queries
xpath_results = '//ul[@class="mw-search-results"]/li'
xpath_link = './/div[@class="mw-search-result-heading"]/a'
+xpath_content = './/div[@class="searchresult"]'
# cut 'en' from 'en-US', 'de' from 'de-CH', and so on
@@ -77,8 +78,6 @@ main_langs = {
'uk': 'Українська',
'zh': '简体中文',
}
-supported_languages = dict(lang_urls, **main_langs)
-
# do search-request
def request(query, params):
@@ -118,7 +117,8 @@ def response(resp):
link = result.xpath(xpath_link)[0]
href = urljoin(base_url, link.attrib.get('href'))
title = extract_text(link)
+ content = extract_text(result.xpath(xpath_content))
- results.append({'url': href, 'title': title})
+ results.append({'url': href, 'title': title, 'content': content})
return results