The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit a222af8a authored by mgasselin's avatar mgasselin Committed by Vincent A

[banquepopulaire] Adapt module for children changes

Module like creditmaritime have some supplementary and different
requests. For example the first login url must be different.
parent 59b626fb
......@@ -50,7 +50,7 @@
NewLoginPage, JsFilePage, AuthorizePage, LoginTokensPage, VkImagePage,
AuthenticationMethodPage, AuthenticationStepPage, CaissedepargneVirtKeyboard,
AccountsNextPage, GenericAccountsPage, InfoTokensPage, NatixisUnavailablePage,
RedirectErrorPage,
RedirectErrorPage, BPCEPage,
)
from .document_pages import BasicTokenPage, SubscriberPage, SubscriptionsPage, DocumentsPage
from .linebourse_browser import LinebourseAPIBrowser
......@@ -115,6 +115,7 @@ def wrapper(browser, *args, **kwargs):
class BanquePopulaire(LoginBrowser):
first_login_page = URL(r'/$')
login_page = URL(r'https://[^/]+/auth/UI/Login.*', LoginPage)
new_login = URL(r'https://[^/]+/.*se-connecter/sso', NewLoginPage)
js_file = URL(r'https://[^/]+/.*se-connecter/main-.*.js$', JsFilePage)
......@@ -206,6 +207,7 @@ class BanquePopulaire(LoginBrowser):
)
redirect_page = URL(r'https://[^/]+/portailinternet/_layouts/Ibp.Cyi.Layouts/RedirectSegment.aspx.*', RedirectPage)
bpce_page = URL(r'https://[^/]+/cyber/ibp/ate/portal/internet89C3Portal.jsp', BPCEPage)
redirect_error_page = URL(
r'https://[^/]+/portailinternet/?$',
......@@ -218,6 +220,7 @@ class BanquePopulaire(LoginBrowser):
r'https://[^/]+/portailinternet/Pages/[dD]efault.aspx',
r'https://[^/]+/portailinternet/Transactionnel/Pages/CyberIntegrationPage.aspx',
r'https://[^/]+/cyber/internet/ShowPortal.do\?token=.*',
r'https://[^/]+/cyber/internet/ShowPortal.do\?taskInfoOID=.*',
HomePage
)
......@@ -326,7 +329,7 @@ def follow_back_button_if_any(self, params=None, actions=None):
@no_need_login
def do_login(self):
try:
self.location(self.BASEURL)
self.first_login_page.go()
except (ClientError, HTTPNotFound) as e:
if e.response.status_code in (403, 404):
# Sometimes the website makes some redirections that leads
......
......@@ -203,6 +203,10 @@ def build_doc(self, data, *args, **kwargs):
return super(MyHTMLPage, self).build_doc(data, *args, **kwargs)
class BPCEPage(LoggedPage, MyHTMLPage):
pass
class RedirectPage(LoggedPage, MyHTMLPage):
ENCODING = None
......
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