Commit fba22b3e authored by Damien Ramelet's avatar Damien Ramelet Committed by Vincent A

[bforbank] Change regex in order to correctly recover url value

On BforBank website, when an user has several accounts, there is a
dropdown with all accounts available. The module iterate over this
dropdown and recover the value attribute of each <option> in order to build the
url that lead to saids accounts.

The previous regex that extract the value attribute was like this:

r'[^\d]' which allow to extract this value 123456789 and lead to build
this kind of url :

BASE_URL/espace-client/rib/123456789

This now lead to a 500 error and a lookalike unavailable/maintenance page.

The value attribute has obviously changed, and now look like this :

COMPTE_TITRE/yLsl6hUcNO_FbC7i9i0fUkFdESgVzGF2nwVuHfQhs08=

PEA/Alql9hUcDO_FbL4i9i4fUoPdJSgQzHF2nwVuHfQhs08=

etc...

r'/(.+)' allow to extract the value following the slash and build
this kind of url:

BASE_URL/espace-client/rib/wk4C9nIlhkw8-DGPATODM4QuZgPTf5-RQb1ftWHpoqA=
parent bd67ef24
......@@ -124,7 +124,7 @@ def populate_rib(self, accounts):
if 'selected' in option.attrib:
self.get_iban(accounts)
else:
page = self.browser.rib.go(id=re.sub(r'[^\d]', '', Attr('.', 'value')(option)))
page = self.browser.rib.go(id=Regexp(Attr('.', 'value'), r'/(.+)')(option))
page.get_iban(accounts)
def get_iban(self, accounts):
......
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