Commit 9cdd4beb authored by Baptiste Delpey's avatar Baptiste Delpey Committed by Romain Bignon

bnp: catch websiteunavailable

parent b3410a85
......@@ -25,6 +25,7 @@ from io import BytesIO
from random import randint
from decimal import Decimal
from datetime import datetime, timedelta
import lxml.html as html
from weboob.browser.elements import DictElement, ListElement, TableElement, ItemElement, method
from weboob.browser.filters.json import Dict
......@@ -219,6 +220,12 @@ class LoginPage(JsonPage):
assert False, 'Unexpected error at login: "%s" (code=%s)' % (msg, error)
parser = html.HTMLParser(encoding=self.encoding)
doc = html.parse(BytesIO(self.content), parser)
error = CleanText('//div[h1[contains(text(), "Incident en cours")]]/p')(doc)
if error:
raise BrowserUnavailable(error)
def login(self, username, password):
url = '/identification-wspl-pres/grille/%s' % self.get('data.grille.idGrille')
keyboard =
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