Fix crash when no data available
This commit is contained in:
parent
7fa67bfc04
commit
87f8b74ab1
1 changed files with 15 additions and 14 deletions
|
|
@ -32,9 +32,10 @@ class DetailsPage(BasePage):
|
||||||
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
self.details = []
|
self.details = []
|
||||||
table = self.document.xpath('//table[@id="reportTable"]')[0]
|
table = self.document.xpath('//table[@id="reportTable"]')
|
||||||
|
|
||||||
for tr in table.xpath('tbody/tr'):
|
if len(table) > 0:
|
||||||
|
for tr in table[0].xpath('tbody/tr'):
|
||||||
detail = Detail()
|
detail = Detail()
|
||||||
# Skip global category
|
# Skip global category
|
||||||
if tr.find('td/a') is not None:
|
if tr.find('td/a') is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue