From 4f5de64f53c6f4a1718f41ef15f4083917241bdc Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Thu, 26 Dec 2019 15:19:09 +0100 Subject: [PATCH] [boursorama] Fixed bug for loans that has no maturity date --- modules/boursorama/pages.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 0a2e0507fa..e32e0ff8d1 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -426,6 +426,9 @@ def obj_total_amount(self): def obj_maturity_date(self): maturity_date = CleanText('//p[contains(text(), "échéance finale")]/span')(self) if maturity_date: + # Sometimes there is no maturity date, so instead there is just a dash + if maturity_date == '-': + return NotAvailable return Date(CleanText('//p[contains(text(), "échéance finale")]/span'), parse_func=parse_french_date)(self) return Date(Regexp(CleanText('//p[contains(text(), "date de votre dernière échéance")]'), r'(\d.*)'), parse_func=parse_french_date, default=NotAvailable)(self) -- GitLab