ameli: prevents crashes when no bills are available
This commit is contained in:
parent
2e0c69df94
commit
db86fe1cbd
1 changed files with 5 additions and 1 deletions
|
|
@ -175,7 +175,11 @@ class PaymentDetailsPage(AmeliBasePage):
|
||||||
|
|
||||||
class BillsPage(AmeliBasePage):
|
class BillsPage(AmeliBasePage):
|
||||||
def iter_bills(self, sub):
|
def iter_bills(self, sub):
|
||||||
table = self.doc.xpath('//table[@id="relevesMensuels"]')[0].xpath('.//tr')
|
try:
|
||||||
|
table = self.doc.xpath('//table[@id="relevesMensuels"]')[0].xpath('.//tr')
|
||||||
|
# When no operations was done in the last month, there is no table. That is fine.
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
for tr in table:
|
for tr in table:
|
||||||
list_tds = tr.xpath('.//td')
|
list_tds = tr.xpath('.//td')
|
||||||
if len(list_tds) == 0:
|
if len(list_tds) == 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue