From 91401fca1442fa4890444cf278b6e7096a1e0775 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 9 Apr 2013 17:47:39 +0200 Subject: [PATCH] detect when there is no operations --- modules/axabanque/pages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/axabanque/pages.py b/modules/axabanque/pages.py index 41d0265b..828a50cd 100644 --- a/modules/axabanque/pages.py +++ b/modules/axabanque/pages.py @@ -227,7 +227,12 @@ class TransactionsPage(BasePage): if len(tables) == 0: tables = self.document.getroot().cssselect('table.table-detail') if len(tables) == 0: - raise BrokenPageError('Unable to find table?') + try: + self.parser.select(self.document.getroot(), 'td.no-result', 1) + except BrokenPageError: + raise BrokenPageError('Unable to find table?') + else: + return for tr in tables[0].xpath('.//tr'): tds = tr.findall('td')