The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 045dcfc8 authored by Fong's avatar Fong Committed by Vincent A

[bp] pro website: fetch savings accounts

Related to rework of LBP pro website: 97968cde1b646cb05f97ae33489440c5979b9256.
Login was fixed in a previous commit so I can now access more connections (and especially
connections with savings accounts) more easily.
parent 215692d3
......@@ -49,7 +49,7 @@ def is_logged(self):
ACCOUNT_TYPES = {
# TODO: add new type names and remove old ones
'Comptes titres': Account.TYPE_MARKET, # old
'Comptes épargne': Account.TYPE_SAVINGS, # old
'COMPTE_EPARGNE': Account.TYPE_SAVINGS,
'COMPTE_COURANT': Account.TYPE_CHECKING,
}
......@@ -67,7 +67,31 @@ def is_logged(self):
class ProAccountsList(LoggedPage, JsonPage):
@method
class iter_accounts(DictElement):
item_xpath = 'comptesBancaires/comptes'
def find_elements(self):
"""
Structure of json:
{
"comptesBancaires": {
"comptes": [{...}],
"...": ...,
},
"comptesEpargnesEtPlacements": {
"comptes": [{...}],
"...": ...,
},
"financements": {
"...": ...,
}
"groupesPersos": ...,
"indicateurCarte": ...,
"numeroCampagne": ...
}
"""
for data in self.el.values():
if not isinstance(data, dict):
continue
for account in data.get('comptes', []):
yield account
class item(ItemElement):
klass = Account
......
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