diff --git a/modules/creditdunord/browser.py b/modules/creditdunord/browser.py index e44a9740cc0e7b8df5d3d485965f328991c3b105..218e8fa930245e99cfc150901b24461cdc3d2d6e 100644 --- a/modules/creditdunord/browser.py +++ b/modules/creditdunord/browser.py @@ -165,11 +165,12 @@ def get_investment(self, account): self.location(account._link, data=account._args) if self.page.can_iter_investments() and self.page.not_restrained(): return self.page.get_market_investment() + elif account.type in (Account.TYPE_LIFE_INSURANCE, Account.TYPE_CAPITALISATION): self.location(account._link, data=account._args) self.location(account._link.replace("_attente", "_detail_contrat_rep"), data=account._args) if self.page.can_iter_investments(): - return self.page.get_deposit_investment() + return self.page.get_li_investments() return [] @need_login diff --git a/modules/creditdunord/pages.py b/modules/creditdunord/pages.py index 65772d92026d40ad23981bbcb740fd95753e3a98..c7c749df6156b6e9644d6c73368cd3c69156a4d3 100755 --- a/modules/creditdunord/pages.py +++ b/modules/creditdunord/pages.py @@ -687,9 +687,9 @@ def condition(self): return "Sous-total" not in Field('label')(self) @method - class get_deposit_investment(TableElement): + class get_li_investments(TableElement): item_xpath = '//table[@class="datas"]//tr[position()>1]' - head_xpath = '//table[@class="datas"]//tr[@class="entete"]/td/b' + head_xpath = '//table[@class="datas"]//tr[@class="entete"]/td/*' col_label = u'Libellé' col_quantity = u'Quantité' @@ -726,7 +726,7 @@ def obj_vdate(self): def fill_diff_currency(self, account): valuation_diff = CleanText(u'//td[span[contains(text(), "dont +/- value : ")]]//b', default=None)(self.doc) - account.balance = CleanDecimal.French(Regexp(CleanText('//table[@class="v1-formbloc"]//td[@class="v1-labels"]/b[contains(text(), "Estimation du contrat")]/ancestor::td/following-sibling::td[1]'), r'^(.+) EUR'))(self.doc) + account.balance = CleanDecimal.French(Regexp(CleanText('//table[@class="v1-formbloc"]//td[@class="v1-labels"]//b[contains(text(), "Estimation du contrat")]/ancestor::td/following-sibling::td[1]'), r'^(.+) EUR'))(self.doc) # NC == Non communiqué if valuation_diff and "NC" not in valuation_diff: account.valuation_diff = MyDecimal().filter(valuation_diff)