fix crash when the card history is empty
This commit is contained in:
parent
9d211201c7
commit
7502310d7e
1 changed files with 3 additions and 2 deletions
|
|
@ -40,10 +40,11 @@ class CardHistory(BasePage):
|
||||||
def get_operations(self):
|
def get_operations(self):
|
||||||
for form in self.document.xpath('//form[@name="marques"]'):
|
for form in self.document.xpath('//form[@name="marques"]'):
|
||||||
for tr in form.xpath('.//tbody/tr'):
|
for tr in form.xpath('.//tbody/tr'):
|
||||||
if tr.attrib.get('class', '') == 'total' or 'style' in tr.attrib:
|
tds = tr.xpath('./td')
|
||||||
|
|
||||||
|
if tr.attrib.get('class', '') == 'total' or 'style' in tr.attrib or len(tds) < 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tds = tr.xpath('./td')
|
|
||||||
date = self.parser.tocleanstring(tds[0])
|
date = self.parser.tocleanstring(tds[0])
|
||||||
label = self.parser.tocleanstring(tds[1])
|
label = self.parser.tocleanstring(tds[1])
|
||||||
amount = self.parser.tocleanstring(tds[2])
|
amount = self.parser.tocleanstring(tds[2])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue