Commit 344415a1 authored by Martin Sicot's avatar Martin Sicot Committed by Romain Bignon

[boursorama] handle paid off loans / no next_payement_date

handle loans paid off without a next_payement_date.
parent 76919d4f
......@@ -346,7 +346,6 @@ class LoanPage(LoggedPage, HTMLPage):
obj_nb_payments_left = CleanDecimal('//p[contains(text(), "Nombre prévisionnel d\'échéances restantes")]/span')
obj_next_payment_amount = CleanDecimal('//p[contains(text(), "Montant de la prochaine échéance")]/span', replace_dots=True)
obj_nb_payments_total = CleanDecimal('//p[contains(text(), "Nombre d\'écheances totales") or contains(text(), "Nombre total d\'échéances")]/span')
obj_next_payment_date = Date(CleanText('//p[contains(text(), "Date de la prochaine échéance")]/span'), parse_func=parse_french_date)
obj_subscription_date = Date(CleanText('//p[contains(text(), "Date de départ du prêt")]/span'), parse_func=parse_french_date)
obj_maturity_date = Date(CleanText('//p[contains(text(), "Date prévisionnelle d\'échéance finale")]/span'), parse_func=parse_french_date)
......@@ -360,6 +359,12 @@ class LoanPage(LoggedPage, HTMLPage):
_type = CleanText('//h2[contains(@class, "page-title__account")]//div[@class="account-edit-label"]/span')
return Map(_type, self.page.LOAN_TYPES, default=Account.TYPE_LOAN)(self)
def obj_next_payment_date(self):
tmp = CleanText('//p[contains(text(), "Date de la prochaine échéance")]/span')(self)
if tmp == "-":
return NotAvailable
return Date(CleanText('//p[contains(text(), "Date de la prochaine échéance")]/span'), parse_func=parse_french_date)(self)
class CardCalendarPage(LoggedPage, RawPage):
def is_here(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment