fix crash when there is no operation on an account
This commit is contained in:
parent
af15086818
commit
d028e803bc
1 changed files with 8 additions and 1 deletions
|
|
@ -45,7 +45,11 @@ class AccountHistory(BasePage):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_transactions(self):
|
def get_transactions(self):
|
||||||
table = self.document.findall('//tbody')[0]
|
try:
|
||||||
|
table = self.document.findall('//tbody')[0]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
for tr in table.xpath('tr'):
|
for tr in table.xpath('tr'):
|
||||||
textdate = tr.find('td[@class="op_date"]').text_content()
|
textdate = tr.find('td[@class="op_date"]').text_content()
|
||||||
textraw = tr.find('td[@class="op_label"]').text_content().strip()
|
textraw = tr.find('td[@class="op_label"]').text_content().strip()
|
||||||
|
|
@ -66,6 +70,9 @@ class AccountHistory(BasePage):
|
||||||
|
|
||||||
def islast(self):
|
def islast(self):
|
||||||
form = self.document.find('//form[@id="navigation_form"]')
|
form = self.document.find('//form[@id="navigation_form"]')
|
||||||
|
if form is None:
|
||||||
|
return True
|
||||||
|
|
||||||
alinks = form.xpath('div/a')
|
alinks = form.xpath('div/a')
|
||||||
for a in alinks:
|
for a in alinks:
|
||||||
if u'Page Suivante' in a.text:
|
if u'Page Suivante' in a.text:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue