summaryrefslogtreecommitdiff
path: root/searx/engines/duckduckgo_definitions.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-01-01 14:14:56 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-01-01 14:14:56 +0100
commit2181c4384ed4d41c795799a345974269327bf641 (patch)
treee1e1394fe9783e653f6e7a2cf659b2edd6664a72 /searx/engines/duckduckgo_definitions.py
parent1408859b4b0ca9efc590ca0e112c6bc0cb984e2c (diff)
downloadsearxng-2181c4384ed4d41c795799a345974269327bf641.tar.gz
searxng-2181c4384ed4d41c795799a345974269327bf641.zip
[mod] purge local html_to_text
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
-rw-r--r--searx/engines/duckduckgo_definitions.py6
1 files changed, 1 insertions, 5 deletions
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}))