Browse Source

[fix] indexing

Adam Tauber 11 years ago
parent
commit
a8a0de644d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      searx/engines/duckduckgo.py

+ 4 - 1
searx/engines/duckduckgo.py

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