fix crash on ASV accounts history

This commit is contained in:
Romain Bignon 2013-03-02 10:28:19 +01:00
commit 61f8ab8920
2 changed files with 9 additions and 0 deletions

View file

@ -120,6 +120,10 @@ class Ing(BaseBrowser):
self.location(self.accountspage, urllib.urlencode(data))
self.where = "history"
jid = self.page.get_history_jid()
if jid is None:
self.logger.info('There is no history for this account')
return
index = 0 # index, we get always the same page, but with more informations
while 1:
hashlist = []

View file

@ -117,6 +117,11 @@ class AccountsList(BasePage):
yield op
def get_history_jid(self):
span = self.document.xpath('//span[@id="index:panelASV"]')
if len(span) > 1:
# Assurance Vie, we do not support this kind of account.
return None
span = self.document.xpath('//span[starts-with(@id, "index:j_id")]')[0]
jid = span.attrib['id'].split(':')[1]
return jid