Beispiel #1
0
    def get_recipients(self):
        # First, internals recipients
        table = self.document.xpath('//table[@id="transfer_form:receiptAccount"]')
        for tr in table[0].xpath('tbody/tr'):
            tds = tr.xpath('td')
            id = tds[0].xpath('input')[0].attrib['value']
            name = tds[0].xpath('label')[0].text
            name += u" " + tds[1].xpath('label')[0].text.replace('\n', '')
            name += u" " + tds[2].xpath('label')[0].text.replace('\n', '')
            recipient = Recipient()
            recipient.id = id
            recipient.label = name
            recipient._type = "int"
            yield recipient

        # Second, externals recipients
        select = self.document.xpath('//select[@id="transfer_form:externalAccounts"]')
        if len(select) > 0:
            recipients = select[0].xpath('option')
            recipients.pop(0)
            for option in recipients:
                recipient = Recipient()
                recipient.id = option.attrib['value']
                recipient.label = option.text
                recipient._type = "ext"
                yield recipient
Beispiel #2
0
    def get_recipients(self):
        # First, internals recipients
        table = self.document.xpath('//table[@id="transfer_form:receiptAccount"]')
        for tr in table[0].xpath('tbody/tr'):
            tds = tr.xpath('td')
            id = tds[0].xpath('input')[0].attrib['value']
            name = tds[0].xpath('label')[0].text
            name += u" " + tds[1].xpath('label')[0].text.replace('\n', '')
            name += u" " + tds[2].xpath('label')[0].text.replace('\n', '')
            recipient = Recipient()
            recipient.id = id
            recipient.label = name
            recipient._type = "int"
            yield recipient

        # Second, externals recipients
        select = self.document.xpath('//select[@id="transfer_form:externalAccounts"]')
        if len(select) > 0:
            recipients = select[0].xpath('option')
            recipients.pop(0)
            for option in recipients:
                recipient = Recipient()
                recipient.id = option.attrib['value']
                recipient.label = option.text
                recipient._type = "ext"
                yield recipient