|
@@ -7,6 +7,7 @@ import re
|
|
|
from urllib.parse import quote, urljoin
|
|
|
from lxml import html
|
|
|
from searx.utils import extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex
|
|
|
+from searx.network import raise_for_httperror
|
|
|
|
|
|
|
|
|
about = {
|
|
@@ -47,6 +48,7 @@ def request(query, params):
|
|
|
|
|
|
|
|
|
params['soft_max_redirects'] = 1
|
|
|
+ params['raise_for_httperror'] = False
|
|
|
return params
|
|
|
|
|
|
|
|
@@ -56,6 +58,11 @@ def response(resp):
|
|
|
'''
|
|
|
results = []
|
|
|
|
|
|
+ if resp.status_code == 404:
|
|
|
+ return results
|
|
|
+
|
|
|
+ raise_for_httperror(resp)
|
|
|
+
|
|
|
dom = html.fromstring(resp.text)
|
|
|
|
|
|
number_of_results_element = eval_xpath_getindex(
|