@@ -1,7 +1,7 @@
11from lxml import html
22from urllib import urlencode, unquote
33from urlparse import urlparse, urljoin
4−from lxml.etree import _ElementStringResult
4+from lxml.etree import _ElementStringResult, _ElementUnicodeResult
55from searx.utils import html_to_text
66
77search_url = None
@@ -29,7 +29,7 @@ def extract_text(xpath_results):
2929 for e in xpath_results:
3030 result = result + extract_text(e)
3131 return result
32− elif type(xpath_results) == _ElementStringResult:
32+ elif type(xpath_results) in [_ElementStringResult, _ElementUnicodeResult]:
3333 # it's a string
3434 return ''.join(xpath_results)
3535 else: