diff --git a/modules/bforbank/browser.py b/modules/bforbank/browser.py index 143b564b6a87d829b2362e5c23b4333a71060507..bbe5e98449ff202767f32a5a9ed59736be6cb2f3 100644 --- a/modules/bforbank/browser.py +++ b/modules/bforbank/browser.py @@ -25,7 +25,7 @@ from .pages import ( LoginPage, ErrorPage, AccountsPage, HistoryPage, LoanHistoryPage, RibPage, LifeInsuranceList, LifeInsuranceIframe, LifeInsuranceRedir, - TitrePage, BoursePage, + BoursePage, ) from .spirica_browser import SpiricaBrowser @@ -45,7 +45,7 @@ class BforbankBrowser(LoginBrowser): lifeinsurance_iframe = URL(r'/client/accounts/lifeInsurance/consultationDetailSpirica.action', LifeInsuranceIframe) lifeinsurance_redir = URL(r'https://assurance-vie.bforbank.com:443/sylvea/welcomeSSO.xhtml', LifeInsuranceRedir) - titre = URL(r'/client/accounts/stocks/consultation/noFramePartenaireCATitres.action\?id=0', TitrePage) + bourse_login = URL(r'/espace-client/synthese/debranchementCaTitre/(?P\d+)') bourse = URL('https://bourse.bforbank.com/netfinca-titres/servlet/com.netfinca.frontcr.synthesis.HomeSynthesis', 'https://bourse.bforbank.com/netfinca-titres/servlet/com.netfinca.frontcr.account.*', BoursePage) @@ -122,9 +122,7 @@ def goto_spirica(self, account): self.spirica.logged = True def get_bourse_account(self, account): - self.titre.go() - assert self.titre.is_here() - self.location(self.page.get_redir()) # "login" to bourse page + self.bourse_login.go(id=account.id) # "login" to bourse page self.bourse.go() assert self.bourse.is_here() @@ -134,6 +132,8 @@ def get_bourse_account(self, account): self.logger.debug('iterating account %r', bourse_account) if bourse_account.id.startswith(account.id[3:]): return bourse_account + else: + raise AccountNotFound() @need_login def iter_investment(self, account): diff --git a/modules/bforbank/pages.py b/modules/bforbank/pages.py index 5a8195db71fed085990fc8d025d47b03980285b7..96ea938cbede911ff69dede95c4ea2a1eadc8b87 100644 --- a/modules/bforbank/pages.py +++ b/modules/bforbank/pages.py @@ -219,11 +219,6 @@ def get_redir(self): return match.group(1) -class TitrePage(LoggedPage, HTMLPage): - def get_redir(self): - return Regexp(CleanText('//body/@onload'), r"document.location='(.*)'", r'\1')(self.doc) - - class BoursePage(AbstractPage): PARENT = 'lcl' PARENT_URL = 'bourse'