Commit 0afaa6eb authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[sgpe] handle BrowserIcorrectPassword case

parent 9d4c21a5
......@@ -27,8 +27,8 @@ from weboob.capabilities.base import find_object
from weboob.capabilities.bank import AccountNotFound
from .pages import (
LoginPage, CardsPage, CardHistoryPage,
ProfileProPage, ProfileEntPage, ChangePassPage, SubscriptionPage
LoginPage, CardsPage, CardHistoryPage, IncorrectLoginPage,
ProfileProPage, ProfileEntPage, ChangePassPage, SubscriptionPage,
)
from .json_pages import AccountsJsonPage, BalancesJsonPage, HistoryJsonPage, BankStatementPage
......@@ -166,6 +166,7 @@ class SGProfessionalBrowser(SGEnterpriseBrowser):
MENUID = 'SBOREL'
CERTHASH = '9f5232c9b2283814976608bfd5bba9d8030247f44c8493d8d205e574ea75148e'
incorrect_login = URL('/authent.html', IncorrectLoginPage)
profile = URL('/gao/modifier-donnees-perso-saisie.html', ProfileProPage)
bank_statement_menu = URL('/icd/syd-front/data/syd-rce-accederDepuisMenu.json', BankStatementPage)
......
......@@ -33,7 +33,7 @@ from weboob.browser.filters.html import Attr
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
from weboob.capabilities.profile import Profile, Person
from weboob.capabilities.bill import Document, Subscription
from weboob.exceptions import ActionNeeded
from weboob.exceptions import ActionNeeded, BrowserIncorrectPassword
from weboob.tools.json import json
from weboob.capabilities.base import NotAvailable
......@@ -238,3 +238,9 @@ class SubscriptionPage(LoggedPage, SGPEPage):
'/Pgn/PrintServlet?PageID=ReleveRIE&MenuID=BANRELRIE&urlTypeTransfert=ipdf&REPORTNAME=ReleveInteretElectronique.sgi&numeroRie=%s',
Regexp(Attr('./td[2]/a', 'onclick'), r"impression\('(.*)'\);")
)
class IncorrectLoginPage(SGPEPage):
def on_load(self):
if self.doc.xpath('//div[@class="ngo_mu_message" and contains(text(), "saisies sont incorrectes")]'):
raise BrowserIncorrectPassword(CleanText('//div[@class="ngo_mu_message"]')(self.doc))
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