瀏覽代碼

[fix] indexing

Adam Tauber 11 年之前
父節點
當前提交
a8a0de644d
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      searx/engines/duckduckgo.py

+ 4
- 1
searx/engines/duckduckgo.py 查看文件

@@ -23,7 +23,10 @@ def response(resp):
23 23
     doc = fromstring(resp.text)
24 24
 
25 25
     for r in doc.xpath(result_xpath):
26
-        res_url = r.xpath(url_xpath)[-1]
26
+        try:
27
+            res_url = r.xpath(url_xpath)[-1]
28
+        except:
29
+            continue
27 30
         if not res_url:
28 31
             continue
29 32
         title = html_to_text(''.join(r.xpath(title_xpath)))