handling website error for market place

This commit is contained in:
Vincent Paredes 2015-08-06 11:10:24 +02:00 committed by Romain Bignon
commit 272ac9f1cd
2 changed files with 5 additions and 0 deletions

View file

@ -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:

View file

@ -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 != '-':