handle login errors
This commit is contained in:
parent
33bbe6d451
commit
e52c6d6b18
2 changed files with 12 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ from weboob.capabilities.bank import Account
|
|||
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||
|
||||
|
||||
__all__ = ['LoginPage', 'IndexPage']
|
||||
__all__ = ['LoginPage', 'ErrorPage', 'IndexPage']
|
||||
|
||||
|
||||
class LoginPage(BasePage):
|
||||
|
|
@ -54,6 +54,13 @@ class LoginPage(BasePage):
|
|||
self.browser.form.action = m.group(1)
|
||||
self.browser.submit(nologin=True)
|
||||
|
||||
class ErrorPage(BasePage):
|
||||
def get_error(self):
|
||||
try:
|
||||
return self.parser.select(self.document.getroot(), 'div.messErreur', 1).text.strip()
|
||||
except BrokenPageError:
|
||||
return None
|
||||
|
||||
class Transaction(FrenchTransaction):
|
||||
PATTERNS = [(re.compile('^CB (?P<text>.*?) FACT (?P<dd>\d{2})(?P<mm>\d{2})(?P<yy>\d{2})'),
|
||||
FrenchTransaction.TYPE_CARD),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue