on master help sign in
[fix] indexing ++ url extraction
01c2eebAdam Tauber
searx/engines/yahoo.py+5−2
@@ -47,8 +47,11 @@ def response(resp):
47 dom = html.fromstring(resp.text)
47 dom = html.fromstring(resp.text)
48
48
49 for result in dom.xpath(results_xpath):
49 for result in dom.xpath(results_xpath):
50+ try:
50− url = parse_url(extract_url(result.xpath(url_xpath), search_url))
51+ url = parse_url(extract_url(result.xpath(url_xpath), search_url))
51− title = extract_text(result.xpath(title_xpath)[0])
52+ title = extract_text(result.xpath(title_xpath)[0])
53+ except:
54+ continue
52 content = extract_text(result.xpath(content_xpath)[0])
55 content = extract_text(result.xpath(content_xpath)[0])
53 results.append({'url': url, 'title': title, 'content': content})
56 results.append({'url': url, 'title': title, 'content': content})
54
57