From d26180c5a8e3b6afa8106f0729072208e90d488e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 28 Oct 2014 10:10:11 +0100 Subject: [PATCH] =?UTF-8?q?fix=20parsing=20of=20labels=20with=20new=20cr?= =?UTF-8?q?=C3=A9dit=20agricole=20website?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To determinate what is the index of label column, we have to consider the 'colspan' attribute of header --- modules/cragr/web/pages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/cragr/web/pages.py b/modules/cragr/web/pages.py index ad944f54..4a53d226 100644 --- a/modules/cragr/web/pages.py +++ b/modules/cragr/web/pages.py @@ -284,6 +284,8 @@ class TransactionsPage(Page): heads = tr.findall('th') for i, head in enumerate(heads): key = self.parser.tocleanstring(head) + if 'colspan' in head.attrib: + i += int(head.get('colspan')) - 1 if key == u'Débit': self.COL_DEBIT = i - len(heads) if key == u'Crédit':