From 01c2eeb8ff055cfecdb8f1b38f284e95c483d5d9 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 21 Mar 2014 16:36:13 +0100 Subject: [PATCH] [fix] indexing ++ url extraction --- searx/engines/yahoo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py index c6cabb58a..f89741839 100644 --- a/searx/engines/yahoo.py +++ b/searx/engines/yahoo.py @@ -47,8 +47,11 @@ def response(resp): dom = html.fromstring(resp.text) for result in dom.xpath(results_xpath): - url = parse_url(extract_url(result.xpath(url_xpath), search_url)) - title = extract_text(result.xpath(title_xpath)[0]) + try: + url = parse_url(extract_url(result.xpath(url_xpath), search_url)) + title = extract_text(result.xpath(title_xpath)[0]) + except: + continue content = extract_text(result.xpath(content_xpath)[0]) results.append({'url': url, 'title': title, 'content': content})