Commit dbc88ff4 authored by Maxime Pommier's avatar Maxime Pommier Committed by Romain Bignon

[banquepopulaire] further fetch token when empty page

 - For some account, the page used to find the token was a 302 that redirect the browser to an
   page where we could not find any usefull information. Added a new page to check if the first
   one was empty.

Closes: 20342@sibi 8050@zendesk
parent 4f36b965
......@@ -412,13 +412,17 @@ class HomePage(LoggedPage, MyHTMLPage):
url = self.browser.absurl('/portailinternet/Transactionnel/Pages/CyberIntegrationPage.aspx')
headers = {'Referer': self.url}
# Sometime, the page is a 302 and redirect to a page where there are no information that we need,
# so we try with 2 others url to further fetch token when empty page
r = self.browser.open(url, data='taskId=aUniversMesComptes', params={'vary': vary}, headers=headers)
if not int(r.headers.get('Content-Length', 0)):
url = self.browser.absurl('/portailinternet/Transactionnel/Pages/CyberIntegrationPage.aspx')
headers = {'Referer': self.url}
r = self.browser.open(url, data='taskId=aUniversMesComptes', headers=headers)
if not int(r.headers.get('Content-Length', 0)):
r = self.browser.open(url, data={'taskId': 'equipementDom'}, params={'vary': vary}, headers=headers)
doc = r.page.doc
date = None
for script in doc.xpath('//script'):
......
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