Fix account list: get all accounts

There is also more logic in the xpath query, which I find more readable.
This commit is contained in:
Laurent Bachelier 2012-03-03 18:26:59 +01:00
commit 6544bbfcdc

View file

@ -34,8 +34,8 @@ class AccountsList(BasePage):
def get_list(self):
l = []
for tr in self.document.getiterator('tr'):
if not 'class' in tr.attrib and tr.find('td') is not None and tr.find('td').attrib.get('class', '') == 'typeTitulaire':
for tr in self.document.xpath('//table[@class="tableCompte"]//tr[not(@class)]'):
if 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'):]
account.link_id = account.id