diff --git a/modules/bred/pages.py b/modules/bred/pages.py index de07365a..b81c6648 100644 --- a/modules/bred/pages.py +++ b/modules/bred/pages.py @@ -18,7 +18,7 @@ # along with weboob. If not, see . -from decimal import Decimal +from decimal import Decimal, InvalidOperation import re from weboob.tools.browser import BasePage @@ -80,7 +80,14 @@ class AccountsPage(BredBasePage): cols = tr.findall('td') - amount = sum([Decimal(txt.strip(' EUR').replace(' ', '').replace(',', '.')) for txt in cols[-1].itertext() if len(txt.strip()) > 0]) + if len(cols) < 2: + continue + + try: + amount = sum([Decimal(txt.strip(' EUR').replace(' ', '').replace(',', '.')) for txt in cols[-1].itertext() if len(txt.strip()) > 0]) + except InvalidOperation: + continue + a = cols[0].find('a') if a is None: # this line is a cards line. attach it on the first account.