From d102d0283c642ecf119a652610138e63998bd2c3 Mon Sep 17 00:00:00 2001 From: Christophe Francois Date: Tue, 15 Jun 2021 10:17:24 +0200 Subject: [PATCH] [bforbank] Fix URL to investments space The previous way to fetch the URL of market accounts now returns a generic URL which results in an error. The correct URL is in a different attribute. I tested that the new URL does lead us to the netfinca space, however I could not test the relogin after leaving it because of the OTP. Closes: 34197@zendesk, 34336@zendesk, 34355@zendesk, 34368@zendesk Closes: 2715@sibi --- modules/bforbank/browser.py | 2 +- modules/bforbank/pages.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/bforbank/browser.py b/modules/bforbank/browser.py index 5200cb4e75..ae24f2b30f 100644 --- a/modules/bforbank/browser.py +++ b/modules/bforbank/browser.py @@ -432,7 +432,7 @@ def goto_spirica(self, account): def get_bourse_account(self, account): owner_name = self.get_profile().name.upper().split(' ', 1)[1] - self.bourse_login.go(id=account.id) # "login" to bourse page + self.location(account.url) self.bourse.go() assert self.bourse.is_here() diff --git a/modules/bforbank/pages.py b/modules/bforbank/pages.py index 2118e88034..90e1b80164 100644 --- a/modules/bforbank/pages.py +++ b/modules/bforbank/pages.py @@ -170,7 +170,10 @@ class item(ItemElement): obj_type = Map(Regexp(Field('label'), r'^([^ ]*)'), TYPE, default=Account.TYPE_UNKNOWN) def obj_url(self): - return urljoin(self.page.url, CleanText('./@data-href')(self)) + path = Attr('.', 'data-href')(self) + if path == '/espace-client/titres': + path = Attr('.', 'data-urlcatitre')(self) + return urljoin(self.page.url, path) obj__card_balance = CleanDecimal('./td//div[@class="synthese-encours"][last()]/div[2]', default=None) -- GitLab