Add 'comptes titres', 'comptes vies', and 'comptes retraites' to the list of boobank/bp accounts (closes #567)

Signed-off-by: Erwan Jahier <jahier@imag.fr>
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Erwan Jahier 2011-04-06 09:04:53 +02:00 committed by Romain Bignon
commit dc5264fbd2
2 changed files with 16 additions and 5 deletions

View file

@ -40,6 +40,7 @@ class BPBrowser(BaseBrowser):
r'.*authentification/verifierMotDePasse-identif.ea' : CheckPassword,
r'.*synthese_assurancesEtComptes/afficheSynthese-synthese\.ea' : AccountList,
r'.*synthese_assurancesEtComptes/rechercheContratAssurance-synthese.ea' : AccountList,
r'.*CCP/releves_ccp/releveCPP-releve_ccp\.ea' : AccountHistory,
r'.*CNE/releveCNE/releveCNE-releve_cne\.ea' : AccountHistory,
@ -74,12 +75,12 @@ class BPBrowser(BaseBrowser):
raise BrowserBanned()
def get_accounts_list(self):
self.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/comptesCommun/synthese_assurancesEtComptes/afficheSynthese-synthese.ea")
self.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/comptesCommun/synthese_assurancesEtComptes/rechercheContratAssurance-synthese.ea")
return self.page.get_accounts_list()
def get_account(self, id):
if not self.is_on_page(AccountList):
self.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/comptesCommun/synthese_assurancesEtComptes/afficheSynthese-synthese.ea")
self.location("https://voscomptesenligne.labanquepostale.fr/voscomptes/canalXHTML/comptesCommun/synthese_assurancesEtComptes/rechercheContratAssurance-synthese.ea")
return self.page.get_account(id)
def get_history(self, Account):

View file

@ -29,6 +29,9 @@ class AccountList(BasePage):
self.account_list = []
self.parse_table('comptes')
self.parse_table('comptesEpargne')
self.parse_table('comptesTitres')
self.parse_table('comptesVie')
self.parse_table('comptesRetraireEuros')
def get_accounts_list(self):
return self.account_list
@ -39,15 +42,22 @@ class AccountList(BasePage):
return
lines = tables[0].xpath(".//tbody/tr")
for line in lines:
account = Account()
tmp = line.xpath("./td//a")[0]
account.label = tmp.text
account.link_id = tmp.get("href")
tmp = line.xpath("./td//strong")
account.id = tmp[0].text
account.balance = float(''.join(tmp[1].text.replace('.','').replace(',','.').split()))
if len(tmp) != 2:
tmp_id = line.xpath("./td//span")[1].text
tmp_balance = tmp[0].text
else:
tmp_id = tmp[0].text
tmp_balance = tmp[1].text
account.id = tmp_id
account.balance = float(''.join(tmp_balance.replace('.','').replace(',','.').split()))
self.account_list.append(account)
def get_account(self, id):