strip agency and key from account IDs

This commit is contained in:
Romain Bignon 2012-02-04 12:38:33 +01:00
commit e1e20a44fe

View file

@ -42,6 +42,9 @@ class AccountsList(BasePage):
if not 'class' in tr.attrib and tr.find('td') is not None and tr.find('td').attrib.get('class', '') == 'typeTitulaire':
account = Account()
account.id = tr.xpath('.//td[@class="libelleCompte"]/input')[0].attrib['id'][len('libelleCompte'):]
if len(str(account.id)) == 23:
account.id = str(account.id)[5:21]
account.label = tr.xpath('.//td[@class="libelleCompte"]/a')[0].text.strip()
tds = tr.findall('td')