From f2d0b514c6c169b97fc24ed7f586d80bc233a0a1 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 14 Jan 2013 22:02:27 +0100 Subject: [PATCH] don't crash if there is an account without account number --- modules/axabanque/pages.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/axabanque/pages.py b/modules/axabanque/pages.py index e2f093fb..716e0893 100644 --- a/modules/axabanque/pages.py +++ b/modules/axabanque/pages.py @@ -121,6 +121,15 @@ class AccountsPage(BasePage): args = self.js2args(link.attrib['onclick']) + self.logger.debug('Args: %r' % args) + if not 'paramNumCompte' in args: + try: + label = unicode(table.xpath('./caption')[0].text.strip()) + except Exception: + label = 'Unable to determine' + self.logger.warning('Unable to get account ID for %r' % label) + continue + account.id = args['paramNumCompte'] account.label = unicode(table.xpath('./caption')[0].text.strip())