Browse Source

[mod] ignore startpage unicode errors

Adam Tauber 10 years ago
parent
commit
c8be128e97
1 changed files with 4 additions and 1 deletions
  1. 4 1
      searx/engines/startpage.py

+ 4 - 1
searx/engines/startpage.py

@@ -66,7 +66,10 @@ def response(resp):
             continue
         link = links[0]
         url = link.attrib.get('href')
-        title = escape(link.text_content())
+        try:
+            title = escape(link.text_content())
+        except UnicodeDecodeError:
+            continue
 
         # block google-ad url's
         if re.match("^http(s|)://www.google.[a-z]+/aclk.*$", url):