From fdcc192f7e2fccc2a6be09cc29c5e7f705605c48 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 10 Dec 2010 16:41:26 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20extraction=20of=20amounts=20>999=20?= =?UTF-8?q?=E2=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weboob/backends/cragr/pages/accounts_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weboob/backends/cragr/pages/accounts_list.py b/weboob/backends/cragr/pages/accounts_list.py index ae61e762..d7473f59 100644 --- a/weboob/backends/cragr/pages/accounts_list.py +++ b/weboob/backends/cragr/pages/accounts_list.py @@ -208,7 +208,7 @@ class AccountsList(CragrBasePage): for body_elmt in interesting_divs: if (self.is_right_aligned_div(body_elmt)): # this is the second line of an operation entry, displaying the amount - data = self.extract_text(body_elmt).replace(',', '.').replace(' ', '') + data = self.extract_text(body_elmt).replace(',', '.').replace(' ', '').replace(u'\xa0', '') matches = re.findall('^(-?[0-9]+\.[0-9]{2}).*$', data) operation.amount = float(matches[0]) if (matches) else 0.0 yield operation @@ -229,7 +229,7 @@ class AccountsList(CragrBasePage): operation = Operation(index) index += 1 # amount - data = self.extract_text(interesting_divs[(i*3)+1]).replace(',', '.').replace(' ', '') + data = self.extract_text(interesting_divs[(i*3)+1]).replace(',', '.').replace(' ', '').replace(u'\xa0', '') matches = re.findall('^(-?[0-9]+\.[0-9]{2}).*$', data) operation.amount = float(matches[0]) if (matches) else 0.0 # date