mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 19:01:00 +00:00
Merge pull request #237 from dalf/master
[fix] close #197 for all engines
This commit is contained in:
commit
3ff269c84c
2 changed files with 5 additions and 5 deletions
|
@ -45,11 +45,6 @@ def request(query, params):
|
||||||
def response(resp):
|
def response(resp):
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
# check if redirect comparing to the True value,
|
|
||||||
# because resp can be a Mock object, and any attribut name returns something.
|
|
||||||
if resp.is_redirect is True:
|
|
||||||
return results
|
|
||||||
|
|
||||||
dom = html.fromstring(resp.text)
|
dom = html.fromstring(resp.text)
|
||||||
|
|
||||||
search_res = dom.xpath('//table[@class="data"]//tr')
|
search_res = dom.xpath('//table[@class="data"]//tr')
|
||||||
|
|
|
@ -87,6 +87,11 @@ def make_callback(engine_name, results_queue, callback, params):
|
||||||
|
|
||||||
# creating a callback wrapper for the search engine results
|
# creating a callback wrapper for the search engine results
|
||||||
def process_callback(response, **kwargs):
|
def process_callback(response, **kwargs):
|
||||||
|
# check if redirect comparing to the True value,
|
||||||
|
# because resp can be a Mock object, and any attribut name returns something.
|
||||||
|
if response.is_redirect is True:
|
||||||
|
return
|
||||||
|
|
||||||
response.search_params = params
|
response.search_params = params
|
||||||
|
|
||||||
timeout_overhead = 0.2 # seconds
|
timeout_overhead = 0.2 # seconds
|
||||||
|
|
Loading…
Reference in a new issue