before the last to include the latest transactions
- # (the last is just card information).
- return CleanText('//table[@class="ca-table"][caption[span[text()="%s"]]]//tr[position()=last()-1]/th/a/@href'
- % raw_number, replace=[(' ', '')])(self.doc)
+ if len(self.doc.xpath('//table[@class="ca-table"][caption[span[text()="%s"]]]//tr' % raw_number)) == 1:
+ # There is only one coming line (no card information link)
+ return CleanText('//table[@class="ca-table"][caption[span[text()="%s"]]]//tr[position()=last()]/th/a/@href'
+ % raw_number, replace=[(' ', '')])(self.doc)
+ elif self.doc.xpath('//table[@class="ca-table"][caption[span[text()="%s"]]]//tr//a[contains(text(), "Infos carte")]' % raw_number):
+ # There is a card information line, select the |