[creditmutuel] correction if there is an info page at first
This commit is contained in:
parent
4fe05dea31
commit
23328e4ce8
2 changed files with 11 additions and 3 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
||||||
|
|
||||||
from .pages import LoginPage, LoginErrorPage, AccountsPage, OperationsPage
|
from .pages import LoginPage, LoginErrorPage, AccountsPage, OperationsPage, InfoPage
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['CreditMutuelBrowser']
|
__all__ = ['CreditMutuelBrowser']
|
||||||
|
|
@ -33,7 +33,8 @@ class CreditMutuelBrowser(BaseBrowser):
|
||||||
PAGES = {'https://www.creditmutuel.fr/groupe/fr/index.html': LoginPage,
|
PAGES = {'https://www.creditmutuel.fr/groupe/fr/index.html': LoginPage,
|
||||||
'https://www.creditmutuel.fr/groupe/fr/identification/default.cgi': LoginErrorPage,
|
'https://www.creditmutuel.fr/groupe/fr/identification/default.cgi': LoginErrorPage,
|
||||||
'https://www.creditmutuel.fr/cmdv/fr/banque/situation_financiere.cgi': AccountsPage,
|
'https://www.creditmutuel.fr/cmdv/fr/banque/situation_financiere.cgi': AccountsPage,
|
||||||
'https://www.creditmutuel.fr/cmdv/fr/banque/mouvements.cgi.*' : OperationsPage
|
'https://www.creditmutuel.fr/cmdv/fr/banque/mouvements.cgi.*' : OperationsPage,
|
||||||
|
'https://www.creditmutuel.fr/cmdv/fr/banque/BAD.*' : InfoPage
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
@ -42,6 +43,10 @@ class CreditMutuelBrowser(BaseBrowser):
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return self.page and not self.is_on_page(LoginPage)
|
return self.page and not self.is_on_page(LoginPage)
|
||||||
|
|
||||||
|
def home(self):
|
||||||
|
return self.location('https://www.creditmutuel.fr/groupe/fr/index.html')
|
||||||
|
|
||||||
|
|
||||||
def login(self):
|
def login(self):
|
||||||
assert isinstance(self.username, basestring)
|
assert isinstance(self.username, basestring)
|
||||||
assert isinstance(self.password, basestring)
|
assert isinstance(self.password, basestring)
|
||||||
|
|
@ -56,7 +61,7 @@ class CreditMutuelBrowser(BaseBrowser):
|
||||||
|
|
||||||
def get_accounts_list(self):
|
def get_accounts_list(self):
|
||||||
if not self.is_on_page(AccountsPage):
|
if not self.is_on_page(AccountsPage):
|
||||||
self.home()
|
self.location('https://www.creditmutuel.fr/cmdv/fr/banque/situation_financiere.cgi')
|
||||||
return self.page.get_list()
|
return self.page.get_list()
|
||||||
|
|
||||||
def get_account(self, id):
|
def get_account(self, id):
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ class LoginPage(BasePage):
|
||||||
class LoginErrorPage(BasePage):
|
class LoginErrorPage(BasePage):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class InfoPage(BasePage):
|
||||||
|
pass
|
||||||
|
|
||||||
class AccountsPage(BasePage):
|
class AccountsPage(BasePage):
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
l = []
|
l = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue