Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[mod] purge local html_to_text

Adam Tauber2181c4384ed4
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index 8f81d2c8e..b66d6c0f2 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -1,6 +1,7 @@
import json
from urllib import urlencode
from lxml import html
+from searx.utils import html_to_text
from searx.engines.xpath import extract_text
url = 'https://api.duckduckgo.com/'\
@@ -17,11 +18,6 @@ def result_to_text(url, text, htmlResult):
return text
-def html_to_text(htmlFragment):
- dom = html.fromstring(htmlFragment)
- return extract_text(dom)
-
-
def request(query, params):
# TODO add kl={locale}
params['url'] = url.format(query=urlencode({'q': query}))