From b6c57554acd44bccd010719ea319704345f0e62c Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Thu, 5 Sep 2019 18:19:56 +0200 Subject: [PATCH] [fortuneo] Add last name+title to CapProfile Adding last name and title of the person to the profile. The first name isn't available in the person's details. --- modules/fortuneo/browser.py | 9 ++++++++- modules/fortuneo/pages/accounts_list.py | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/fortuneo/browser.py b/modules/fortuneo/browser.py index 1949e34a83..876f92ed00 100644 --- a/modules/fortuneo/browser.py +++ b/modules/fortuneo/browser.py @@ -290,4 +290,11 @@ def get_profile(self): csv_link = self.page.get_csv_link() if csv_link: self.location(csv_link) - return self.page.get_profile() + return self.page.get_profile() + # The persons name is in a menu not returned in the ProfilePage, so + # we have to go back to the AccountsPage (which is the main page for the website) + # to get the info + person = self.page.get_profile() + self.accounts_page.go() + self.page.fill_person_name(obj=person) + return person diff --git a/modules/fortuneo/pages/accounts_list.py b/modules/fortuneo/pages/accounts_list.py index 5e4e5be86f..7ac35ba9d5 100644 --- a/modules/fortuneo/pages/accounts_list.py +++ b/modules/fortuneo/pages/accounts_list.py @@ -365,6 +365,14 @@ def has_action_needed(self): if warning: raise ActionNeeded(warning[0].text) + @method + class fill_person_name(ItemElement): + klass = Account + + # Contains the title (M., Mme., etc) + last name. + # The first name isn't available in the person's details. + obj_name = CleanText('//span[has-class("mon_espace_nom")]') + def get_iframe_url(self): iframe = self.doc.xpath('//iframe[@id="iframe_centrale"]') if iframe: -- GitLab