fix crash when there is no operation on an account

This commit is contained in:
Romain Bignon 2012-12-24 13:32:43 +01:00
commit d028e803bc

View file

@ -45,7 +45,11 @@ class AccountHistory(BasePage):
pass
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'):
textdate = tr.find('td[@class="op_date"]').text_content()
textraw = tr.find('td[@class="op_label"]').text_content().strip()
@ -66,6 +70,9 @@ class AccountHistory(BasePage):
def islast(self):
form = self.document.find('//form[@id="navigation_form"]')
if form is None:
return True
alinks = form.xpath('div/a')
for a in alinks:
if u'Page Suivante' in a.text: