diff --git a/modules/sogecartenet/pages.py b/modules/sogecartenet/pages.py index 25ed00615681793904f1a2640730b90e30b8bfd4..78781534a77a8a865608e5cba8b617f08ae02aba 100644 --- a/modules/sogecartenet/pages.py +++ b/modules/sogecartenet/pages.py @@ -20,7 +20,7 @@ import requests from weboob.browser.pages import HTMLPage, CsvPage, pagination -from weboob.exceptions import BrowserIncorrectPassword, BrowserPasswordExpired +from weboob.exceptions import BrowserIncorrectPassword, BrowserPasswordExpired, NoAccountsException from weboob.browser.elements import DictElement, ItemElement, method, TableElement from weboob.browser.filters.standard import CleanText, CleanDecimal, Date, Env from weboob.browser.filters.html import TableCell @@ -59,6 +59,11 @@ class iter_accounts(TableElement): col_id = 'card iconetriwbeb(2);' col_label = 'name iconetriwbeb(1);' + def parse(self, el): + msg = CleanText('//font[@color="#FF0000"]')(self) + if msg and 'NO INFORMATION AVAILABLE.' in msg: + raise NoAccountsException() + def next_page(self): array_page = self.page.doc.xpath('//table[3]')[0] if array_page.xpath('.//a[@href="javascript:fctSuivant();"]'):