From bab81079c41f3bab9ca4d278bc94138c1cf748f7 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Tue, 9 Jul 2019 11:54:26 +0200 Subject: [PATCH] [groupama] Updated login procedure to repair children ganassurances & ganpatrimoine The login process was obsolete and led to a lot of unnecessary redirections (302). By starting with the exact request done by the real website we avoid 5 useless redirections and enable this parent module to work for its children again. Closes: 42594@sibi --- modules/groupama/browser.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/groupama/browser.py b/modules/groupama/browser.py index c98e9a9114..0589bd5bbe 100644 --- a/modules/groupama/browser.py +++ b/modules/groupama/browser.py @@ -33,25 +33,24 @@ class GroupamaBrowser(LoginBrowser): BASEURL = 'https://espaceclient.groupama.fr' - login = URL('/wps/portal/login', - 'https://authentification.(ganassurances|ganpatrimoine|groupama).fr/cas/login', - '/wps/portal/inscription', LoginPage) - iban = URL('/wps/myportal/!ut/(.*)/\?paramNumCpt=(.*)', IbanPage) - accounts = URL('/wps/myportal/TableauDeBord', AccountsPage) - transactions = URL('/wps/myportal/!ut', TransactionsPage) - av_account_form = URL('/wps/myportal/assurancevie/', FormPage) - av_account = URL('https://secure-rivage.(ganassurances|ganpatrimoine|groupama).fr/contratVie.rivage.syntheseContratEparUc.gsi', - '/front/vie/epargne/contrat/(.*)', AVAccountPage) - av_history = URL('https://secure-rivage.(?P.*).fr/contratVie.rivage.mesOperations.gsi', AVHistoryPage) - av_secondary = URL('/api/ecli/vie/contrats/(?P.*)', AvJPage) + login = URL(r'https://authentification.(?P.*).fr/cas/login', LoginPage) + iban = URL(r'/wps/myportal/!ut/(.*)/\?paramNumCpt=(.*)', IbanPage) + accounts = URL(r'/wps/myportal/TableauDeBord', AccountsPage) + transactions = URL(r'/wps/myportal/!ut', TransactionsPage) + av_account_form = URL(r'/wps/myportal/assurancevie/', FormPage) + av_account = URL(r'https://secure-rivage.(ganassurances|ganpatrimoine|groupama).fr/contratVie.rivage.syntheseContratEparUc.gsi', + r'/front/vie/epargne/contrat/(.*)', AVAccountPage) + av_history = URL(r'https://secure-rivage.(?P.*).fr/contratVie.rivage.mesOperations.gsi', AVHistoryPage) + av_secondary = URL(r'/api/ecli/vie/contrats/(?P.*)', AvJPage) def __init__(self, *args, **kwargs): super(GroupamaBrowser, self).__init__(*args, **kwargs) self.website = 'groupama' + self.domain = 'groupama' def do_login(self): - self.login.stay_or_go() - + login_url = 'https://espaceclient.%s.fr/login-%s' % (self.website, self.domain) + self.login.go(website=self.website, params={'service': login_url}) self.page.login(self.username, self.password) if self.login.is_here(): -- GitLab