Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[mod] hardening xpath engine: ignore empty results

Markus Heiser540323a4b069
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index 97c84bd09..90b551a33 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -269,6 +269,10 @@ def response(resp): # pylint: disable=too-many-branches
raise_for_httperror(resp)
results = []
+
+ if not resp.text:
+ return results
+
dom = html.fromstring(resp.text)
is_onion = 'onions' in categories