fix parsing card pages in special fucking cases
This commit is contained in:
parent
07038a9989
commit
bf177f71ad
4 changed files with 8 additions and 6 deletions
|
|
@ -130,7 +130,8 @@ class CICBrowser(BaseBrowser):
|
||||||
# useful with 12 -> 1
|
# useful with 12 -> 1
|
||||||
if int(args['mois']) < month:
|
if int(args['mois']) < month:
|
||||||
month = month + 1
|
month = month + 1
|
||||||
month = int(args['mois'])
|
else:
|
||||||
|
month = int(args['mois'])
|
||||||
|
|
||||||
for tr in self.list_operations(card_link):
|
for tr in self.list_operations(card_link):
|
||||||
if month > last_debit:
|
if month > last_debit:
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ class CardPage(OperationsPage):
|
||||||
def get_history(self):
|
def get_history(self):
|
||||||
index = 0
|
index = 0
|
||||||
for tr in self.document.xpath('//table[@class="liste"]/tbody/tr'):
|
for tr in self.document.xpath('//table[@class="liste"]/tbody/tr'):
|
||||||
tds = tr.findall('td')
|
tds = tr.findall('td')[:4]
|
||||||
if len(tds) < 4:
|
if len(tds) < 4:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ class CardPage(OperationsPage):
|
||||||
raw=u' '.join(parts))
|
raw=u' '.join(parts))
|
||||||
tr.type = tr.TYPE_CARD
|
tr.type = tr.TYPE_CARD
|
||||||
|
|
||||||
tr.set_amount(tds[-1].text.rstrip('EUR'))
|
tr.set_amount(tds[-1].text)
|
||||||
yield tr
|
yield tr
|
||||||
|
|
||||||
class NoOperationsPage(OperationsPage):
|
class NoOperationsPage(OperationsPage):
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,8 @@ class CreditMutuelBrowser(BaseBrowser):
|
||||||
# useful with 12 -> 1
|
# useful with 12 -> 1
|
||||||
if int(args['mois']) < month:
|
if int(args['mois']) < month:
|
||||||
month = month + 1
|
month = month + 1
|
||||||
month = int(args['mois'])
|
else:
|
||||||
|
month = int(args['mois'])
|
||||||
|
|
||||||
for tr in self.list_operations(card_link):
|
for tr in self.list_operations(card_link):
|
||||||
if month > last_debit:
|
if month > last_debit:
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ class CardPage(OperationsPage):
|
||||||
def get_history(self):
|
def get_history(self):
|
||||||
index = 0
|
index = 0
|
||||||
for tr in self.document.xpath('//table[@class="liste"]/tbody/tr'):
|
for tr in self.document.xpath('//table[@class="liste"]/tbody/tr'):
|
||||||
tds = tr.findall('td')
|
tds = tr.findall('td')[:4]
|
||||||
if len(tds) < 4:
|
if len(tds) < 4:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ class CardPage(OperationsPage):
|
||||||
raw=u' '.join(parts))
|
raw=u' '.join(parts))
|
||||||
tr.type = tr.TYPE_CARD
|
tr.type = tr.TYPE_CARD
|
||||||
|
|
||||||
tr.set_amount(tds[-1].text.rstrip('EUR'))
|
tr.set_amount(tds[-1].text)
|
||||||
yield tr
|
yield tr
|
||||||
|
|
||||||
class NoOperationsPage(OperationsPage):
|
class NoOperationsPage(OperationsPage):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue