fix list index out of range on iter_accounts
This commit is contained in:
parent
96b5108e78
commit
70548ec7f8
1 changed files with 4 additions and 0 deletions
|
|
@ -82,6 +82,8 @@ class AccountsPage(Page):
|
||||||
accounts = OrderedDict()
|
accounts = OrderedDict()
|
||||||
|
|
||||||
for tr in self.document.getiterator('tr'):
|
for tr in self.document.getiterator('tr'):
|
||||||
|
if not tr.getchildren():
|
||||||
|
continue
|
||||||
first_td = tr.getchildren()[0]
|
first_td = tr.getchildren()[0]
|
||||||
if (first_td.attrib.get('class', '') == 'i g' \
|
if (first_td.attrib.get('class', '') == 'i g' \
|
||||||
or first_td.attrib.get('class', '') == 'p g' \
|
or first_td.attrib.get('class', '') == 'p g' \
|
||||||
|
|
@ -101,6 +103,8 @@ class AccountsPage(Page):
|
||||||
|
|
||||||
for i in (2,1):
|
for i in (2,1):
|
||||||
if tr.getchildren()[i].text is None:
|
if tr.getchildren()[i].text is None:
|
||||||
|
if not tr.getchildren()[i].getchildren():
|
||||||
|
continue
|
||||||
amout = tr.getchildren()[i].getchildren()[0].text
|
amout = tr.getchildren()[i].getchildren()[0].text
|
||||||
else:
|
else:
|
||||||
amout = tr.getchildren()[i].text
|
amout = tr.getchildren()[i].text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue