From 70548ec7f8a6b1561c46eb9428024b8932d7c0d5 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Wed, 13 May 2015 14:56:57 +0200 Subject: [PATCH] fix list index out of range on iter_accounts --- modules/cic/pages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/cic/pages.py b/modules/cic/pages.py index c8b93175..3a0d4d7e 100644 --- a/modules/cic/pages.py +++ b/modules/cic/pages.py @@ -82,6 +82,8 @@ class AccountsPage(Page): accounts = OrderedDict() for tr in self.document.getiterator('tr'): + if not tr.getchildren(): + continue first_td = tr.getchildren()[0] if (first_td.attrib.get('class', '') == 'i g' \ or first_td.attrib.get('class', '') == 'p g' \ @@ -101,6 +103,8 @@ class AccountsPage(Page): for i in (2,1): if tr.getchildren()[i].text is None: + if not tr.getchildren()[i].getchildren(): + continue amout = tr.getchildren()[i].getchildren()[0].text else: amout = tr.getchildren()[i].text