浏览代码

[mod] purge local html_to_text

Adam Tauber 10 年前
父节点
当前提交
2181c4384e
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1
    5
      searx/engines/duckduckgo_definitions.py

+ 1
- 5
searx/engines/duckduckgo_definitions.py 查看文件

@@ -1,6 +1,7 @@
1 1
 import json
2 2
 from urllib import urlencode
3 3
 from lxml import html
4
+from searx.utils import html_to_text
4 5
 from searx.engines.xpath import extract_text
5 6
 
6 7
 url = 'https://api.duckduckgo.com/'\
@@ -17,11 +18,6 @@ def result_to_text(url, text, htmlResult):
17 18
         return text
18 19
 
19 20
 
20
-def html_to_text(htmlFragment):
21
-    dom = html.fromstring(htmlFragment)
22
-    return extract_text(dom)
23
-
24
-
25 21
 def request(query, params):
26 22
     # TODO add kl={locale}
27 23
     params['url'] = url.format(query=urlencode({'q': query}))