fix a crash on iter_accounts after an investment on banquepopulaire

This commit is contained in:
Baptiste Delpey 2015-05-25 14:03:36 +02:00 committed by Romain Bignon
commit 81b0d2add3
2 changed files with 7 additions and 0 deletions

View file

@ -97,6 +97,8 @@ class BanquePopulaire(Browser):
for taskInfoOID in self.ACCOUNT_URLS:
self.location(self.buildurl('/cyber/internet/StartTask.do', taskInfoOID=taskInfoOID, token=self.token))
if not self.page.is_error():
if self.page.pop_up():
self.location(self.buildurl('/cyber/internet/StartTask.do', taskInfoOID=taskInfoOID, token=self.page.get_token()))
self.ACCOUNT_URLS = [taskInfoOID]
break
else:

View file

@ -333,6 +333,11 @@ class AccountsPage(BasePage):
return False
def pop_up(self):
if self.document.xpath('//span[contains(text(), "du navigateur Internet.")]'):
return True
return False
def is_short_list(self):
return len(self.document.xpath('//script[contains(text(), "EQUIPEMENT_COMPLET")]')) > 0