diff options
| author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-09 21:25:13 +0100 |
|---|---|---|
| committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-09 21:30:09 +0100 |
| commit | 400b54191c590663f0cfe91045f70a5d9223aa19 (patch) | |
| tree | 08c71466ac8fbaf69872f114847baec762f5bd81 /searx/engines/duckduckgo_definitions.py | |
| parent | af8dac93a8acff5042b7b399c38e348f0bdc32ad (diff) | |
| parent | c8be128e97479ea6c871c4b6fbf014fa8136e708 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx into code_results
Conflicts:
searx/engines/searchcode_code.py
searx/engines/searchcode_doc.py
searx/static/oscar/js/searx.min.js
searx/templates/oscar/result_templates/default.html
searx/templates/oscar/result_templates/images.html
searx/templates/oscar/result_templates/map.html
searx/templates/oscar/result_templates/torrent.html
searx/templates/oscar/result_templates/videos.html
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
| -rw-r--r-- | searx/engines/duckduckgo_definitions.py | 6 |
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})) |