diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index 3aec68fc34c2378f15a5bc6a46e08d01772487c0..6bff755aacdd63a30c827816052b2b939136ef7d 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -395,6 +395,8 @@ def loans_conso(self): def get_measure_accounts_list(self): self.home.go() + owner_name = self.get_profile().name.upper().split(' ', 1)[1] + # Make sure we are on list of measures page if self.measure_page.is_here(): self.page.check_no_accounts() @@ -403,7 +405,7 @@ def get_measure_accounts_list(self): for measure_id in measure_ids: self.page.go_measure_accounts_list(measure_id) if self.page.check_measure_accounts(): - for account in list(self.page.get_list()): + for account in list(self.page.get_list(owner_name)): account._info['measure_id'] = measure_id self.accounts.append(account) self.page.go_measure_list() diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 17c2937b391af62cd39e5589412792cba7fdb252..176cd4c7d0f4ab212c7ee2a4e18c43edfaf5fd86 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -384,6 +384,7 @@ def get_list(self, owner_name): else: # On the same row, there could have many accounts (check account and a card one). # For the card line, the number will be the same than the checking account, so we skip it. + ownership = self.get_ownership(tds, owner_name) if len(tds) > 4: for i, a in enumerate(tds[2].xpath('./a')): label = CleanText('.')(a) @@ -393,13 +394,13 @@ def get_list(self, owner_name): # checking parent account, we have to skip it. if i == 0: number = CleanText('.')(tds[-4].xpath('./a')[0]) - self._add_account(accounts, a, label, account_type, balance, number) + self._add_account(accounts, a, label, account_type, balance, number, ownership=ownership) # Only 4 tds on "banque de la reunion" website. elif len(tds) == 4: for i, a in enumerate(tds[1].xpath('./a')): label = CleanText('.')(a) balance = CleanText('.')(tds[-1].xpath('./a')[i]) - self._add_account(accounts, a, label, account_type, balance) + self._add_account(accounts, a, label, account_type, balance, ownership=ownership) self.logger.warning('we are on the %s website', 'old' if accounts else 'new')