Fix livret A history (site changed)
The url is still valid, but the html code look like the normal account.
This commit is contained in:
parent
6e430010ab
commit
03f68b4207
3 changed files with 10 additions and 40 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser
|
from weboob.tools.browser import BaseBrowser
|
||||||
from .pages import AccountsList, LoginPage, LoginPage2, \
|
from .pages import AccountsList, LoginPage, LoginPage2, \
|
||||||
AccountHistoryCC, AccountHistoryLA
|
AccountHistory
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Ing']
|
__all__ = ['Ing']
|
||||||
|
|
@ -33,8 +33,8 @@ class Ing(BaseBrowser):
|
||||||
PAGES = {'.*displayTRAccountSummary.*': AccountsList,
|
PAGES = {'.*displayTRAccountSummary.*': AccountsList,
|
||||||
'.*displayLogin.jsf': LoginPage,
|
'.*displayLogin.jsf': LoginPage,
|
||||||
'.*displayLogin.jsf.*': LoginPage2,
|
'.*displayLogin.jsf.*': LoginPage2,
|
||||||
'.*accountDetail.jsf.*': AccountHistoryCC,
|
'.*accountDetail.jsf.*': AccountHistory,
|
||||||
'.*displayTRHistoriqueLA.*': AccountHistoryLA
|
'.*displayTRHistoriqueLA.*': AccountHistory
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@
|
||||||
|
|
||||||
|
|
||||||
from .accounts_list import AccountsList
|
from .accounts_list import AccountsList
|
||||||
from .account_history import AccountHistoryCC, AccountHistoryLA
|
from .account_history import AccountHistory
|
||||||
from .login import LoginPage, LoginPage2, ConfirmPage, MessagePage
|
from .login import LoginPage, LoginPage2, ConfirmPage, MessagePage
|
||||||
|
|
||||||
|
|
||||||
class AccountPrelevement(AccountsList):
|
class AccountPrelevement(AccountsList):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
__all__ = ['AccountsList', 'AccountHistoryCC', 'AccountHistoryLA', 'LoginPage',
|
__all__ = ['AccountsList', 'AccountHistory', 'LoginPage',
|
||||||
'LoginPage2', 'ConfirmPage', 'MessagePage', 'AccountPrelevement']
|
'LoginPage2', 'ConfirmPage', 'MessagePage', 'AccountPrelevement']
|
||||||
|
|
|
||||||
|
|
@ -27,23 +27,18 @@ from weboob.capabilities.bank import Transaction
|
||||||
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AccountHistoryCC', 'AccountHistoryLA']
|
__all__ = ['AccountHistory']
|
||||||
|
|
||||||
|
|
||||||
class TransactionCC(FrenchTransaction):
|
class Transaction(FrenchTransaction):
|
||||||
PATTERNS = [(re.compile(u'^retrait dab (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{4}) (?P<text>.*)'), FrenchTransaction.TYPE_WITHDRAWAL),
|
PATTERNS = [(re.compile(u'^retrait dab (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{4}) (?P<text>.*)'), FrenchTransaction.TYPE_WITHDRAWAL),
|
||||||
(re.compile(u'^carte (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{4}) (?P<text>.*)'), Transaction.TYPE_CARD),
|
(re.compile(u'^carte (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{4}) (?P<text>.*)'), Transaction.TYPE_CARD),
|
||||||
(re.compile(u'^virement ((sepa emis vers|recu)?) (?P<text>.*)'), Transaction.TYPE_TRANSFER),
|
(re.compile(u'^virement ((sepa emis vers|recu|emis)?) (?P<text>.*)'), Transaction.TYPE_TRANSFER),
|
||||||
(re.compile(u'^prelevement (?P<text>.*)'), Transaction.TYPE_ORDER),
|
(re.compile(u'^prelevement (?P<text>.*)'), Transaction.TYPE_ORDER),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class TransactionAA(FrenchTransaction):
|
class AccountHistory(BasePage):
|
||||||
PATTERNS = [(re.compile(u'^(?P<category>VIREMENT (RECU|EMIS VERS)?) (?P<text>.*)'), FrenchTransaction.TYPE_TRANSFER),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class AccountHistoryCC(BasePage):
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
self.transactions = []
|
self.transactions = []
|
||||||
table = self.document.findall('//tbody')[0]
|
table = self.document.findall('//tbody')[0]
|
||||||
|
|
@ -51,7 +46,7 @@ class AccountHistoryCC(BasePage):
|
||||||
for tr in table.xpath('tr'):
|
for tr in table.xpath('tr'):
|
||||||
id = i
|
id = i
|
||||||
texte = tr.text_content().split('\n')
|
texte = tr.text_content().split('\n')
|
||||||
op = TransactionCC(id)
|
op = Transaction(id)
|
||||||
op.parse(date = date(*reversed([int(x) for x in texte[0].split('/')])),
|
op.parse(date = date(*reversed([int(x) for x in texte[0].split('/')])),
|
||||||
raw = texte[2])
|
raw = texte[2])
|
||||||
# force the use of website category
|
# force the use of website category
|
||||||
|
|
@ -64,28 +59,3 @@ class AccountHistoryCC(BasePage):
|
||||||
|
|
||||||
def get_transactions(self):
|
def get_transactions(self):
|
||||||
return self.transactions
|
return self.transactions
|
||||||
|
|
||||||
|
|
||||||
class AccountHistoryLA(BasePage):
|
|
||||||
|
|
||||||
def on_loaded(self):
|
|
||||||
self.transactions = []
|
|
||||||
i = 1
|
|
||||||
history = self.document.xpath('//tr[@align="center"]')
|
|
||||||
history.pop(0)
|
|
||||||
for tr in history:
|
|
||||||
id = i
|
|
||||||
texte = tr.text_content().strip().split('\n')
|
|
||||||
op = TransactionAA(id)
|
|
||||||
# The size is not the same if there are two dates or only one
|
|
||||||
length = len(texte)
|
|
||||||
op.parse(date = date(*reversed([int(x) for x in texte[0].split('/')])),
|
|
||||||
raw = unicode(texte[length - 2].strip()))
|
|
||||||
|
|
||||||
op.amount = Decimal(op.clean_amount(texte[length - 1]))
|
|
||||||
|
|
||||||
self.transactions.append(op)
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
def get_transactions(self):
|
|
||||||
return self.transactions
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue