From 5e1f313efb622682ada596ffd595fbce4badb3f0 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 28 Oct 2014 18:31:32 +0100 Subject: [PATCH] fix the fix, because old website version had also a colspan but in the other side --- modules/cragr/web/pages.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/cragr/web/pages.py b/modules/cragr/web/pages.py index 4a53d226..e61c497f 100644 --- a/modules/cragr/web/pages.py +++ b/modules/cragr/web/pages.py @@ -284,8 +284,6 @@ 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': @@ -317,8 +315,11 @@ class TransactionsPage(Page): t.rdate = t.date t.raw = raw - # On some accounts' history page, there is a tag in columns. col_text = cols[self.COL_TEXT] + if len(col_text.xpath('.//br')) == 0: + col_text = cols[self.COL_TEXT+1] + + # On some accounts' history page, there is a tag in columns. if col_text.find('font') is not None: col_text = col_text.find('font')