fix crash on a new tab

This commit is contained in:
Romain Bignon 2013-03-12 11:55:34 +01:00
commit 95e4e0d887

View file

@ -112,6 +112,10 @@ class AccountsPage(BasePage):
for table in self.document.getroot().cssselect('div#table-panorama table.table-client'):
account = Account()
tds = table.xpath('./tbody/tr')[0].findall('td')
if len(tds) < 3:
continue
link = table.xpath('./tfoot//a')[0]
if not 'onclick' in link.attrib:
continue
@ -140,8 +144,6 @@ class AccountsPage(BasePage):
else:
account.currency = account.get_currency(m.group(1))
tds = table.xpath('./tbody/tr')[0].findall('td')
account.balance = Decimal(FrenchTransaction.clean_amount(u''.join([txt.strip() for txt in tds[-1].itertext()])))
account._args = args
yield account