Example #1
0
    def obj__redacted_card(self):
        raw = Field('raw')(self)
        if not raw.startswith('FACTURE CARTE') or ' SUIVANT RELEVE DU ' in raw:
            return

        page = Async('details').loaded_page(self)
        return page.get_redacted_card()
Example #2
0
            def obj_id(self):
                history_url = Field('_history_url')(self)
                if history_url.startswith('javascript:'):
                    # Market account
                    page = self.page.browser.investment.go()

                    area_id = Regexp(
                        CleanText('//span[@class="CelMnTiersT1"]'),
                        r'\((\d+)\)',
                        default='')(page.doc)

                    for tr in page.doc.xpath(
                            './/table/tr[not(has-class("LnTit")) and not(has-class("LnTot"))]'
                    ):
                        # Try to match account with id and balance.
                        if CleanText('./td[2]//a')(tr) == Field('label')(self) \
                            and CleanDecimal('./td[3]//a')(tr) == Field('balance')(self):

                            acc_id = CleanText('./td[1]',
                                               replace=[(' ', '')])(tr)
                            if area_id:
                                # because the acc_id can be the same between multiple areas
                                return '%s.%s' % (area_id, acc_id)
                            return acc_id
                else:
                    page = self.page.browser.open(history_url).page
                    return Regexp(CleanText('//span[has-class("Rappel")]'),
                                  '(\d{18}) | (\d{3}\w\d{15})')(page.doc)
Example #3
0
    def obj__redacted_card(self):
        raw = Field('raw')(self)

        if not raw.startswith('FACTURE CARTE') or ' SUIVANT RELEVE DU ' in raw:
            return

        page = Async('details').loaded_page(self)
        return page.get_redacted_card()