diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-03-04 19:47:24 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-03-04 19:47:24 +0100 |
| commit | e86947d79c0c1b380e718bc06072285e8a6ca8ed (patch) | |
| tree | b560ae360b1e9909f93a0a55f65fcffdbb549601 | |
| parent | 693415c78707a2bb01bc952bd977292cc67a7f26 (diff) | |
| parent | 6f535b6fae878c1fb8520c944156c7dc4b81228d (diff) | |
Merge pull request #44 from potato/master
[fix] xpath_results in extract_text
| -rw-r--r-- | searx/engines/xpath.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index 9af24de3b..72120304e 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -1,7 +1,7 @@ from lxml import html from urllib import urlencode, unquote from urlparse import urlparse, urljoin -from lxml.etree import _ElementStringResult +from lxml.etree import _ElementStringResult, _ElementUnicodeResult from searx.utils import html_to_text search_url = None @@ -29,7 +29,7 @@ def extract_text(xpath_results): for e in xpath_results: result = result + extract_text(e) return result - elif type(xpath_results) == _ElementStringResult: + elif type(xpath_results) in [_ElementStringResult, _ElementUnicodeResult]: # it's a string return ''.join(xpath_results) else: |