fix connection on other kind of accounts
This commit is contained in:
parent
a84979a927
commit
5ff52844a5
2 changed files with 12 additions and 2 deletions
|
|
@ -45,6 +45,7 @@ class BanquePopulaire(BaseBrowser):
|
||||||
'https://[^/]+/portailinternet/Catalogue/Segments/.*.aspx(\?vary=(?P<vary>.*))?': HomePage,
|
'https://[^/]+/portailinternet/Catalogue/Segments/.*.aspx(\?vary=(?P<vary>.*))?': HomePage,
|
||||||
'https://[^/]+/portailinternet/Pages/.*.aspx\?vary=(?P<vary>.*)': HomePage,
|
'https://[^/]+/portailinternet/Pages/.*.aspx\?vary=(?P<vary>.*)': HomePage,
|
||||||
'https://[^/]+/portailinternet/Pages/default.aspx': HomePage,
|
'https://[^/]+/portailinternet/Pages/default.aspx': HomePage,
|
||||||
|
'https://[^/]+/portailinternet/Transactionnel/Pages/CyberIntegrationPage.aspx': HomePage,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, website, *args, **kwargs):
|
def __init__(self, website, *args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
from urlparse import urlsplit, parse_qsl
|
from urlparse import urlsplit, parse_qsl
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import re
|
import re
|
||||||
from mechanize import Cookie
|
from mechanize import Cookie, FormNotFoundError
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage as _BasePage, BrowserUnavailable, BrokenPageError
|
from weboob.tools.browser import BasePage as _BasePage, BrowserUnavailable, BrokenPageError
|
||||||
from weboob.capabilities.bank import Account
|
from weboob.capabilities.bank import Account
|
||||||
|
|
@ -135,6 +135,13 @@ class RedirectPage(BasePage):
|
||||||
if redirect_url is not None:
|
if redirect_url is not None:
|
||||||
self.browser.location(self.browser.request_class(self.browser.absurl(redirect_url), None, {'Referer': self.url}))
|
self.browser.location(self.browser.request_class(self.browser.absurl(redirect_url), None, {'Referer': self.url}))
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.browser.select_form(name="CyberIngtegrationPostForm")
|
||||||
|
except FormNotFoundError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.browser.submit(nologin=True)
|
||||||
|
|
||||||
|
|
||||||
class UnavailablePage(BasePage):
|
class UnavailablePage(BasePage):
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
|
|
@ -219,7 +226,9 @@ class AccountsPage(BasePage):
|
||||||
|
|
||||||
def is_error(self):
|
def is_error(self):
|
||||||
for script in self.document.xpath('//script'):
|
for script in self.document.xpath('//script'):
|
||||||
if script.text is not None and u"Le service est momentanément indisponible" in script.text:
|
if script.text is not None and \
|
||||||
|
(u"Le service est momentanément indisponible" in script.text or
|
||||||
|
u"Votre abonnement ne vous permet pas d'accéder à ces services" in script.text):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue