Commit c0ea8d86 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Vincent A

[aviva] handle other case for opening date

Opening date titles may vary so we must handle both with Coalesce.
parent a8f8936d
......@@ -83,7 +83,12 @@ class InvestmentPage(LoggedPage, HTMLPage):
obj_valuation_diff = CleanDecimal.French('//h3[contains(., "value latente")]/following-sibling::p[1]', default=NotAvailable)
obj_type = MapIn(Lower(CleanText('//h3[contains(text(), "Type de produit")]/following-sibling::p')), ACCOUNT_TYPES, Account.TYPE_UNKNOWN)
obj_opening_date = Date(CleanText('''//h3[contains(text(), "Date d'effet de l'adhésion")]/following-sibling::p'''), dayfirst=True)
# Opening date titles may have slightly different names and apostrophe characters
obj_opening_date = Coalesce(
Date(CleanText('''//h3[contains(text(), "Date d'effet de l'adhésion")]/following-sibling::p'''), dayfirst=True, default=NotAvailable),
Date(CleanText('''//h3[contains(text(), "Date d’effet d’adhésion")]/following-sibling::p'''), dayfirst=True, default=NotAvailable),
def get_history_link(self):
history_link = self.doc.xpath('//li/a[contains(text(), "Historique")]/@href')
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