浏览代码

[fix] html tag removal

asciimoo 11 年前
父节点
当前提交
59eeeaab87
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      searx/engines/xpath.py

+ 2
- 1
searx/engines/xpath.py 查看文件

2
 from urllib import urlencode, unquote
2
 from urllib import urlencode, unquote
3
 from urlparse import urlparse, urljoin
3
 from urlparse import urlparse, urljoin
4
 from lxml.etree import _ElementStringResult
4
 from lxml.etree import _ElementStringResult
5
+from searx.utils import html_to_text
5
 
6
 
6
 search_url = None
7
 search_url = None
7
 url_xpath = None
8
 url_xpath = None
33
         return ''.join(xpath_results)
34
         return ''.join(xpath_results)
34
     else:
35
     else:
35
         # it's a element
36
         # it's a element
36
-        return xpath_results.text_content()
37
+        return html_to_text(xpath_results.text_content())
37
 
38
 
38
 
39
 
39
 def extract_url(xpath_results):
40
 def extract_url(xpath_results):