fix detection of card pages

This commit is contained in:
Romain Bignon 2014-01-14 11:33:34 +01:00
commit 33b9ae23be

View file

@ -208,16 +208,16 @@ class TransactionsPage(BasePage):
last_debit = None
transactions = []
# check if it's a card page, so by default transactions are not yet debited.
if len(self.document.xpath('//div[@class="scrollTbody"]/table//th')) == 6 and is_coming is None:
is_coming = True
for tr in self.document.xpath('//div[@class="scrollTbody"]/table//tr'):
cols = tr.findall('td')
if len(cols) < 4:
continue
# check if it's a card page, so by default transactions are not yet debited.
if len(cols) == 6 and is_coming is None:
is_coming = True
col_label = cols[1]
if col_label.find('a') is not None:
col_label = col_label.find('a')