summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-03-21 16:36:13 +0100
committerAdam Tauber <asciimoo@gmail.com>2014-03-21 16:36:13 +0100
commit01c2eeb8ff055cfecdb8f1b38f284e95c483d5d9 (patch)
tree4c3bf959ce0ae87be2794de4137e460717a8bc3a /searx/engines
parent3854703d952d22257841f4f6d85921a340c72da5 (diff)
downloadsearxng-01c2eeb8ff055cfecdb8f1b38f284e95c483d5d9.tar.gz
searxng-01c2eeb8ff055cfecdb8f1b38f284e95c483d5d9.zip
[fix] indexing ++ url extraction
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/yahoo.py7
1 files 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})