SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] error when xpath_results in extraxt_text is _ElementUnicodeResult instead of _ElementStringResult
potato6f535b6fae87
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.pyindex 9af24de3b..72120304e 100644--- a/searx/engines/xpath.py+++ b/searx/engines/xpath.py@@ -1,7 +1,7 @@from lxml import htmlfrom urllib import urlencode, unquotefrom urlparse import urlparse, urljoin-from lxml.etree import _ElementStringResult+from lxml.etree import _ElementStringResult, _ElementUnicodeResultfrom searx.utils import html_to_textsearch_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 stringreturn ''.join(xpath_results)else: