From fd597ea63797366050fabe6f41cc027d2511d926 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 29 Sep 2013 17:47:31 +0200 Subject: [PATCH] do not crash if there is no operation --- modules/ing/pages/titre.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ing/pages/titre.py b/modules/ing/pages/titre.py index f72ddb44..a6a9d913 100644 --- a/modules/ing/pages/titre.py +++ b/modules/ing/pages/titre.py @@ -61,7 +61,11 @@ class TitreHistory(BasePage): pass def iter_history(self): - table = self.document.xpath('//table[@class="datas retour"]')[0] + try: + table = self.document.xpath('//table[@class="datas retour"]')[0] + except IndexError: + return # noop + trs = table.xpath('tr') trs.pop(0) trs.pop(-1)