From 9f13af8d3c96741e69f50b23abca9bd5a5e19998 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 4 Feb 2015 20:41:40 +0100 Subject: Yahoo's unit test --- searx/engines/yahoo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searx/engines/yahoo.py') diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py index c6c5b0d0d..161f7513b 100644 --- a/searx/engines/yahoo.py +++ b/searx/engines/yahoo.py @@ -35,7 +35,7 @@ suggestion_xpath = '//div[@id="satat"]//a' def parse_url(url_string): endings = ['/RS', '/RK'] endpositions = [] - start = url_string.find('http', url_string.find('/RU=')+1) + start = url_string.find('http', url_string.find('/RU=') + 1) for ending in endings: endpos = url_string.rfind(ending) @@ -91,7 +91,7 @@ def response(resp): 'content': content}) # if no suggestion found, return results - if not suggestion_xpath: + if not dom.xpath(suggestion_xpath): return results # parse suggestion -- cgit v1.2.3