From 57436e0899101b2cbf4469b0c7998b4b7c49409f Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 3 Jul 2012 10:08:02 +0200 Subject: [PATCH] fix when there are several amounts for a card --- modules/bred/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bred/pages.py b/modules/bred/pages.py index dbc3538a..6138b013 100644 --- a/modules/bred/pages.py +++ b/modules/bred/pages.py @@ -76,7 +76,7 @@ class AccountsPage(BredBasePage): cols = tr.findall('td') - amount = Decimal(u''.join([txt.strip() for txt in cols[-1].itertext()]).strip(' EUR').replace(' ', '').replace(',', '.')) + amount = sum([Decimal(txt.strip(' EUR').replace(' ', '').replace(',', '.')) for txt in cols[-1].itertext() if len(txt.strip()) > 0]) a = cols[0].find('a') if a is None: # this line is a cards line. attach it on the first account.