diff --git a/searx/engines/base.py b/searx/engines/base.py
index ff006a3b..be0b7d24 100755
--- a/searx/engines/base.py
+++ b/searx/engines/base.py
@@ -73,7 +73,7 @@ def request(query, params):
def response(resp):
results = []
- search_results = etree.XML(resp.text)
+ search_results = etree.XML(resp.content)
for entry in search_results.xpath('./result/doc'):
content = "No description available"
diff --git a/tests/unit/engines/test_base.py b/tests/unit/engines/test_base.py
index e008b034..b5da5bde 100644
--- a/tests/unit/engines/test_base.py
+++ b/tests/unit/engines/test_base.py
@@ -21,10 +21,10 @@ class TestBaseEngine(SearxTestCase):
self.assertRaises(AttributeError, base.response, '')
self.assertRaises(AttributeError, base.response, '[]')
- response = mock.Mock(text='')
+ response = mock.Mock(content=b'')
self.assertEqual(base.response(response), [])
- xml_mock = """
+ xml_mock = b"""
0
@@ -83,7 +83,7 @@ class TestBaseEngine(SearxTestCase):
"""
- response = mock.Mock(text=xml_mock.encode('utf-8'))
+ response = mock.Mock(content=xml_mock)
results = base.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)