From baedabde1f93bc6810647552274013ceb51001b9 Mon Sep 17 00:00:00 2001 From: Jerome Berthier Date: Fri, 21 Jun 2019 10:31:03 +0200 Subject: [PATCH] [caissedepargne] fix websiteUnavailable when fetching cards For some accounts without cards the server closes the session when we try to reach CardsPage. We avoid this problem by checking whether there is a link to the cards before trying to go. --- modules/caissedepargne/pages.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 30996e23d3..3a2d31c97f 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -559,7 +559,13 @@ def go_list(self): self.submit_form(form, eventargument, eventtarget, scriptmanager) def go_cards(self): + # Do not try to go the card summary if we have no card, it breaks the session + if not CleanText('//form[@id="main"]//a/span[text()="Mes cartes bancaires"]')(self.doc): + self.logger.info("Do not try to go the CardsPage, there is not link on the main page") + return + form = self.get_form(id='main') + eventargument = "" if "MM$m_CH$IsMsgInit" in form: -- GitLab