소스 검색

[fix] indexing ++ url extraction

Adam Tauber 11 년 전
부모
커밋
01c2eeb8ff
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5
    2
      searx/engines/yahoo.py

+ 5
- 2
searx/engines/yahoo.py 파일 보기

@@ -47,8 +47,11 @@ def response(resp):
47 47
     dom = html.fromstring(resp.text)
48 48
 
49 49
     for result in dom.xpath(results_xpath):
50
-        url = parse_url(extract_url(result.xpath(url_xpath), search_url))
51
-        title = extract_text(result.xpath(title_xpath)[0])
50
+        try:
51
+            url = parse_url(extract_url(result.xpath(url_xpath), search_url))
52
+            title = extract_text(result.xpath(title_xpath)[0])
53
+        except:
54
+            continue
52 55
         content = extract_text(result.xpath(content_xpath)[0])
53 56
         results.append({'url': url, 'title': title, 'content': content})
54 57