correctly handle expired sessions
This commit is contained in:
parent
4df4c85aa0
commit
794e506432
1 changed files with 11 additions and 3 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from weboob.browser.pages import HTMLPage, LoggedPage, pagination
|
from weboob.browser.pages import HTMLPage, pagination
|
||||||
from weboob.browser.elements import ListElement, ItemElement, method
|
from weboob.browser.elements import ListElement, ItemElement, method
|
||||||
from weboob.browser.filters.standard import CleanText, CleanDecimal, Regexp, DateGuesser, Env
|
from weboob.browser.filters.standard import CleanText, CleanDecimal, Regexp, DateGuesser, Env
|
||||||
from weboob.browser.filters.html import Link
|
from weboob.browser.filters.html import Link
|
||||||
|
|
@ -41,11 +41,19 @@ class LoginPage(HTMLPage):
|
||||||
form.submit()
|
form.submit()
|
||||||
|
|
||||||
|
|
||||||
|
class CMSOPage(HTMLPage):
|
||||||
|
@property
|
||||||
|
def logged(self):
|
||||||
|
if len(self.doc.xpath('//b[text()="Session interrompue"]')) > 0:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class CmsoListElement(ListElement):
|
class CmsoListElement(ListElement):
|
||||||
item_xpath = '//table[@class="Tb" and tr[1][@class="LnTit"]]/tr[@class="LnA" or @class="LnB"]'
|
item_xpath = '//table[@class="Tb" and tr[1][@class="LnTit"]]/tr[@class="LnA" or @class="LnB"]'
|
||||||
|
|
||||||
|
|
||||||
class AccountsPage(LoggedPage, HTMLPage):
|
class AccountsPage(CMSOPage):
|
||||||
@method
|
@method
|
||||||
class iter_accounts(CmsoListElement):
|
class iter_accounts(CmsoListElement):
|
||||||
class item(ItemElement):
|
class item(ItemElement):
|
||||||
|
|
@ -69,7 +77,7 @@ class CmsoTransactionElement(ItemElement):
|
||||||
return len(self.el) >= 5 and not self.el.get('id', '').startswith('libelleLong')
|
return len(self.el) >= 5 and not self.el.get('id', '').startswith('libelleLong')
|
||||||
|
|
||||||
|
|
||||||
class HistoryPage(LoggedPage, HTMLPage):
|
class HistoryPage(CMSOPage):
|
||||||
def iter_history(self, *args, **kwargs):
|
def iter_history(self, *args, **kwargs):
|
||||||
if self.doc.xpath('//a[@href="1-situationGlobaleProfessionnel.act"]'):
|
if self.doc.xpath('//a[@href="1-situationGlobaleProfessionnel.act"]'):
|
||||||
return self.iter_history_rest_page(*args, **kwargs)
|
return self.iter_history_rest_page(*args, **kwargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue