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