Commit 9cfa846a authored by Tony Malto's avatar Tony Malto Committed by Romain Bignon

[sogecartenet] raise NoAccountsException when needed

Closes: 501341@redmine
parent 80d8d4f9
......@@ -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 AccountsPage(SogeLoggedPage, HTMLPage):
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();"]'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment