fix parsing history when there are extra columns

This commit is contained in:
Romain Bignon 2012-04-17 23:19:09 +02:00
commit 9e41cd9483

View file

@ -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