Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
135
Issues
135
List
Boards
Labels
Milestones
Merge Requests
41
Merge Requests
41
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
f265722d
Commit
f265722d
authored
Nov 12, 2012
by
Romain Bignon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support when website is unavailable
parent
e7c8e8c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
browser.py
modules/caissedepargne/browser.py
+2
-1
pages.py
modules/caissedepargne/pages.py
+9
-2
No files found.
modules/caissedepargne/browser.py
View file @
f265722d
...
...
@@ -22,7 +22,7 @@ from urlparse import urlsplit
from
weboob.tools.browser
import
BaseBrowser
,
BrowserIncorrectPassword
from
.pages
import
LoginPage
,
IndexPage
,
ErrorPage
from
.pages
import
LoginPage
,
IndexPage
,
ErrorPage
,
UnavailablePage
__all__
=
[
'CaisseEpargne'
]
...
...
@@ -35,6 +35,7 @@ class CaisseEpargne(BaseBrowser):
PAGES
=
{
'https://[^/]+.caisse-epargne.fr/particuliers/ind_pauthpopup.aspx.*'
:
LoginPage
,
'https://[^/]+.caisse-epargne.fr/Portail.aspx'
:
IndexPage
,
'https://[^/]+.caisse-epargne.fr/login.aspx'
:
ErrorPage
,
'https://[^/]+.caisse-epargne.fr/page_hs_dei_.*.aspx'
:
UnavailablePage
,
}
def
is_logged
(
self
):
...
...
modules/caissedepargne/pages.py
View file @
f265722d
...
...
@@ -22,12 +22,12 @@ from decimal import Decimal
import
re
from
weboob.tools.mech
import
ClientForm
from
weboob.tools.browser
import
BasePage
,
BrokenPageError
from
weboob.tools.browser
import
BasePage
,
BrokenPageError
,
BrowserUnavailable
from
weboob.capabilities.bank
import
Account
from
weboob.tools.capabilities.bank.transactions
import
FrenchTransaction
__all__
=
[
'LoginPage'
,
'ErrorPage'
,
'IndexPage'
]
__all__
=
[
'LoginPage'
,
'ErrorPage'
,
'IndexPage'
,
'UnavailablePage'
]
class
LoginPage
(
BasePage
):
...
...
@@ -61,6 +61,13 @@ class ErrorPage(BasePage):
except
BrokenPageError
:
return
None
class
UnavailablePage
(
BasePage
):
def
on_loaded
(
self
):
try
:
raise
BrowserUnavailable
(
self
.
parser
.
select
(
self
.
document
.
getroot
(),
'div#message_error_hs'
,
1
)
.
text
.
strip
())
except
BrokenPageError
:
raise
BrowserUnavailable
()
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
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment