diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index de4d16c1..011597d9 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -142,6 +142,8 @@ class CaisseEpargne(Browser): self.page.go_history(account._info) if account.type is Account.TYPE_MARKET: self.page.submit() + if self.page.is_error(): + return iter([]) self.location('https://www.caisse-epargne.offrebourse.com/Portefeuille') elif account.type is Account.TYPE_LIFE_INSURANCE: try: diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 8c171747..5b8c870d 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -376,6 +376,9 @@ class IndexPage(Page): class MarketPage(Page): + def is_error(self): + return self.document.xpath('//caption')[0].text == "Erreur" + def parse_decimal(self, td): value = self.parser.tocleanstring(td) if value and value != '-':