Commit bd89e265 authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

[fortuneo] detect BrowserUnavailable at login

parent 6289da2a
......@@ -21,7 +21,8 @@
from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword
from weboob.capabilities.bank import Account
from .pages.login import LoginPage
from .pages.login import LoginPage, UnavailablePage
from .pages.accounts_list import GlobalAccountsList, AccountsList, AccountHistoryPage, CardHistoryPage, \
InvestmentHistoryPage, PeaHistoryPage, LoanPage
......@@ -48,6 +49,7 @@ class Fortuneo(LoginBrowser):
r'.*/prive/mes-comptes/ppe/.*', PeaHistoryPage)
invest_history = URL(r'.*/prive/mes-comptes/assurance-vie/.*', InvestmentHistoryPage)
loan_contract = URL(r'/fr/prive/mes-comptes/credit-immo/contrat-credit-immo/contrat-pret-immobilier.jsp.*', LoanPage)
unavailable = URL(r'/customError/indispo.html', UnavailablePage)
def __init__(self, *args, **kwargs):
LoginBrowser.__init__(self, *args, **kwargs)
......
......@@ -18,8 +18,6 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
#from logging import error
from weboob.browser.pages import HTMLPage
from weboob.browser.filters.standard import CleanText
from weboob.exceptions import BrowserUnavailable
......@@ -38,4 +36,9 @@ class LoginPage(HTMLPage):
form.submit()
class UnavailablePage(HTMLPage):
def on_load(self):
raise BrowserUnavailable(CleanText('//h2[@class="titre"]')(self.doc))
# vim:ts=4:sw=4
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