From c8be128e97479ea6c871c4b6fbf014fa8136e708 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 9 Jan 2015 11:21:46 +0100 Subject: [PATCH] [mod] ignore startpage unicode errors --- searx/engines/startpage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index 16da728cd..70b193952 100644 --- a/searx/engines/startpage.py +++ b/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):