fix parsing card pages in special fucking cases

This commit is contained in:
Romain Bignon 2013-01-16 11:44:25 +01:00
commit bf177f71ad
4 changed files with 8 additions and 6 deletions

View file

@ -130,7 +130,8 @@ class CICBrowser(BaseBrowser):
# useful with 12 -> 1
if int(args['mois']) < month:
month = month + 1
month = int(args['mois'])
else:
month = int(args['mois'])
for tr in self.list_operations(card_link):
if month > last_debit:

View file

@ -154,7 +154,7 @@ class CardPage(OperationsPage):
def get_history(self):
index = 0
for tr in self.document.xpath('//table[@class="liste"]/tbody/tr'):
tds = tr.findall('td')
tds = tr.findall('td')[:4]
if len(tds) < 4:
continue
@ -166,7 +166,7 @@ class CardPage(OperationsPage):
raw=u' '.join(parts))
tr.type = tr.TYPE_CARD
tr.set_amount(tds[-1].text.rstrip('EUR'))
tr.set_amount(tds[-1].text)
yield tr
class NoOperationsPage(OperationsPage):