From 9e41cd9483e8d832da70bc19ddb248cdccca346a Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 17 Apr 2012 23:19:09 +0200 Subject: [PATCH] fix parsing history when there are extra columns --- modules/creditmutuel/pages.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index f2d80526..1afad71d 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -98,7 +98,13 @@ class OperationsPage(BasePage): def get_history(self): index = 0 for tr in self.document.getiterator('tr'): - tds = tr.getchildren() + # columns can be: + # - date | value | operation | debit | credit | contre-valeur + # - date | value | operation | debit | credit + # - date | operation | debit | credit + # That's why we skip any extra columns, and take operation, debit + # and credit from last instead of first indexes. + tds = tr.getchildren()[:5] if len(tds) < 4: continue