Commit 96133d1f authored by Edouard Lambert's avatar Edouard Lambert Committed by Romain Bignon

fixing spirica : handle maintenance page

parent 42c6ce2d
......@@ -21,7 +21,7 @@
from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage, DetailsPage
from .pages import LoginPage, AccountsPage, DetailsPage, MaintenancePage
class SpiricaBrowser(LoginBrowser):
......@@ -29,6 +29,7 @@ class SpiricaBrowser(LoginBrowser):
login = URL('/securite/login.xhtml', LoginPage)
accounts = URL('/sylvea/client/synthese.xhtml', AccountsPage)
details = URL('/sylvea/contrat/consultationContratEpargne.xhtml', DetailsPage)
maintenance = URL('/maintenance.html', MaintenancePage)
def __init__(self, website, username, password, *args, **kwargs):
super(LoginBrowser, self).__init__(*args, **kwargs)
......@@ -26,6 +26,7 @@
from weboob.browser.filters.html import Attr, Link
from import Account, Investment, Transaction
from weboob.capabilities.base import NotAvailable
from weboob.exceptions import BrowserUnavailable
def MyDecimal(*args, **kwargs):
......@@ -33,6 +34,11 @@ def MyDecimal(*args, **kwargs):
return CleanDecimal(*args, **kwargs)
class MaintenancePage(HTMLPage):
def on_load(self):
raise BrowserUnavailable(CleanText().filter(self.doc.xpath('//p')))
class LoginPage(HTMLPage):
def login(self, login, password):
form = self.get_form('//form[@id="loginForm"]')
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