Parcourir la source

[mod] ignore startpage unicode errors

Adam Tauber il y a 10 ans
Parent
révision
c8be128e97
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4
    1
      searx/engines/startpage.py

+ 4
- 1
searx/engines/startpage.py Voir le fichier

66
             continue
66
             continue
67
         link = links[0]
67
         link = links[0]
68
         url = link.attrib.get('href')
68
         url = link.attrib.get('href')
69
-        title = escape(link.text_content())
69
+        try:
70
+            title = escape(link.text_content())
71
+        except UnicodeDecodeError:
72
+            continue
70
 
73
 
71
         # block google-ad url's
74
         # block google-ad url's
72
         if re.match("^http(s|)://www.google.[a-z]+/aclk.*$", url):
75
         if re.match("^http(s|)://www.google.[a-z]+/aclk.*$", url):