detection of accounts type
This commit is contained in:
parent
35e2e38207
commit
a069ae387e
1 changed files with 9 additions and 2 deletions
|
|
@ -122,6 +122,10 @@ class AccountsList(Page):
|
||||||
form = self.document.xpath('//form[@name="InformationsPersonnellesForm"]')
|
form = self.document.xpath('//form[@name="InformationsPersonnellesForm"]')
|
||||||
return len(form) > 0
|
return len(form) > 0
|
||||||
|
|
||||||
|
ACCOUNT_TYPES = {'mes-comptes/compte-courant': Account.TYPE_CHECKING,
|
||||||
|
'mes-comptes/assurance-vie': Account.TYPE_MARKET,
|
||||||
|
'mes-comptes/livret': Account.TYPE_LOAN,
|
||||||
|
}
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
for cpt in self.document.xpath(".//*[@class='synthese_id_compte']"):
|
for cpt in self.document.xpath(".//*[@class='synthese_id_compte']"):
|
||||||
account = Account()
|
account = Account()
|
||||||
|
|
@ -154,8 +158,11 @@ class AccountsList(Page):
|
||||||
account._link_id = url_to_parse
|
account._link_id = url_to_parse
|
||||||
|
|
||||||
# account.label
|
# account.label
|
||||||
temp_label = cpt.xpath('./text()')[1].replace(u'-\xa0', '').replace("\n", "").replace("\t", "")
|
account.label = cpt.xpath('./text()')[1].replace(u'-\xa0', '').replace("\n", "").replace("\t", "")
|
||||||
account.label = " ".join(temp_label.split(" ")[:2])
|
|
||||||
|
for pattern, type in self.ACCOUNT_TYPES.iteritems():
|
||||||
|
if pattern in account._link_id:
|
||||||
|
account.type = type
|
||||||
|
|
||||||
yield account
|
yield account
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue