From 4f36b96529a25bfa6ab0ed58a66e19a0d71c9aa8 Mon Sep 17 00:00:00 2001 From: Martin Sicot Date: Fri, 16 Nov 2018 10:48:34 +0100 Subject: [PATCH] [boursorama] Correct date format for loans and xpath Use parse_french_date instead of Date to get the different dates for the loans. --- modules/boursorama/pages.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 1ac9b41061..04010db035 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -349,13 +349,13 @@ class get_loan(ItemElement): obj_total_amount = CleanDecimal('//p[contains(text(), "Montant emprunt")]/span', replace_dots=True) obj_currency = CleanCurrency('//p[contains(text(), "Montant emprunt")]/span') obj_duration = CleanDecimal('//p[contains(text(), "Nombre prévisionnel d\'échéances restantes")]/span') - obj_subscription_date = Date(CleanText('//p[contains(text(), "Date de départ du prêt")]/span')) - obj_maturity_date = Date(CleanText('//p[contains(text(), "Date prévisionnelle d\'échéance finale")]/span')) obj_rate = CleanDecimal('//p[contains(text(), "Taux nominal en vigueur du prêt")]/span') obj_nb_payments_left = CleanDecimal('//p[contains(text(), "Nombre prévisionnel d\'échéances restantes")]/span') - obj_nb_payments_total = CleanDecimal('//p[contains(text(), "Nombre d\'écheances totales")]/span') obj_next_payment_amount = CleanDecimal('//p[contains(text(), "Montant de la prochaine échéance")]/span', replace_dots=True) - obj_next_payment_date = Date(CleanText('//p[contains(text(), "Date de la prochaine échéance")]/span')) + 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) def obj_balance(self): balance = CleanDecimal('//p[contains(text(), "Capital restant dû")]/span', replace_dots=True)(self) -- GitLab