From eb7a6b746c496551dc4bcc8be5e64dc61f69ccce Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 18 May 2010 00:58:35 +0200 Subject: [PATCH] dlfp sucks --- weboob/backends/dlfp/pages/news.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weboob/backends/dlfp/pages/news.py b/weboob/backends/dlfp/pages/news.py index 81390b37..fbb49079 100644 --- a/weboob/backends/dlfp/pages/news.py +++ b/weboob/backends/dlfp/pages/news.py @@ -19,10 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ from datetime import datetime +from logging import warning from weboob.tools.misc import local2utc - from weboob.backends.dlfp.tools import url2id + from .index import DLFPPage class Comment(object): @@ -41,7 +42,10 @@ class Comment(object): if sub.tag == 'a': self.id = sub.attrib['name'] elif sub.tag == 'h1': - self.title = sub.find('b').text + try: + self.title = sub.find('b').text + except UnicodeError: + warning('Bad encoded title, but DLFP sucks') elif sub.tag == 'div' and sub.attrib.get('class', '').startswith('comment'): self.author = sub.find('a').text self.date = self.parse_date(sub.find('i').tail)