The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

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

bnp: catch websiteunavailable

parent b3410a85
......@@ -25,6 +25,7 @@
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 @@ def on_load(self):
else:
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 = self.browser.open(url)
......
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