pass page which asks to update personnal information

This commit is contained in:
Romain Bignon 2013-03-02 11:42:07 +01:00
commit 9e2d318c38
2 changed files with 20 additions and 12 deletions

View file

@ -22,7 +22,7 @@
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
from .pages.login import LoginPage from .pages.login import LoginPage
from .pages.accounts_list import AccountsList, AccountHistoryPage from .pages.accounts_list import GlobalAccountsList, AccountsList, AccountHistoryPage
__all__ = ['Fortuneo'] __all__ = ['Fortuneo']
@ -33,13 +33,14 @@ class Fortuneo(BaseBrowser):
CERTHASH = ['f71bd27994f395963c4a500d9d330cb50cef37ee5946146f9ca2492c2552b2ba', '97628e02c676d88bb8eb6d91a10b50cffd7275e273902975b4e1eb7154270c4e'] CERTHASH = ['f71bd27994f395963c4a500d9d330cb50cef37ee5946146f9ca2492c2552b2ba', '97628e02c676d88bb8eb6d91a10b50cffd7275e273902975b4e1eb7154270c4e']
ENCODING = None # refer to the HTML encoding ENCODING = None # refer to the HTML encoding
PAGES = { PAGES = {
'.*identification\.jsp.*' : LoginPage, '.*identification\.jsp.*' : LoginPage,
'.*prive/default\.jsp.*' : AccountsList, '.*prive/default\.jsp.*' : AccountsList,
'.*/prive/mes-comptes/synthese-mes-comptes\.jsp' : AccountsList, '.*/prive/mes-comptes/synthese-mes-comptes\.jsp' : AccountsList,
'.*/prive/mes-comptes/synthese-globale/synthese-mes-comptes\.jsp' : GlobalAccountsList,
'.*/prive/mes-comptes/livret/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage, '.*/prive/mes-comptes/livret/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage,
'.*/prive/mes-comptes/compte-courant/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage, '.*/prive/mes-comptes/compte-courant/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage,
} }
@ -49,15 +50,12 @@ class Fortuneo(BaseBrowser):
def home(self): def home(self):
"""main page (login)""" """main page (login)"""
self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/identification.jsp') self.login()
def is_logged(self): def is_logged(self):
"""Return True if we are logged on website""" """Return True if we are logged on website"""
if self.is_on_page(AccountHistoryPage) or self.is_on_page(AccountsList): return self.page is not None and not self.is_on_page(LoginPage)
return True
else:
return False
def login(self): def login(self):
"""Login to the website. """Login to the website.
@ -77,6 +75,9 @@ class Fortuneo(BaseBrowser):
self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/mes-comptes/synthese-mes-comptes.jsp') self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/mes-comptes/synthese-mes-comptes.jsp')
if self.is_on_page(AccountsList) and self.page.need_reload():
self.location('/ReloadContext?action=1&')
def get_history(self, account): def get_history(self, account):
if not self.is_on_page(AccountHistoryPage): if not self.is_on_page(AccountHistoryPage):
self.location(account._link_id) self.location(account._link_id)

View file

@ -27,7 +27,7 @@ from weboob.capabilities import NotAvailable
from weboob.tools.capabilities.bank.transactions import FrenchTransaction from weboob.tools.capabilities.bank.transactions import FrenchTransaction
__all__ = ['AccountsList', 'AccountHistoryPage'] __all__ = ['GlobalAccountsList', 'AccountsList', 'AccountHistoryPage']
class Transaction(FrenchTransaction): class Transaction(FrenchTransaction):
@ -90,6 +90,10 @@ class AccountsList(BasePage):
if len(warn) > 0: if len(warn) > 0:
raise BrowserIncorrectPassword(warn[0].text) raise BrowserIncorrectPassword(warn[0].text)
def need_reload(self):
form = self.document.xpath('//form[@name="InformationsPersonnellesForm"]')
return len(form) > 0
def get_list(self): def get_list(self):
l = [] l = []
@ -131,4 +135,7 @@ class AccountsList(BasePage):
return l return l
class GlobalAccountsList(BasePage):
pass
# vim:ts=4:sw=4 # vim:ts=4:sw=4