From 61f8ab89206a01efb2ece3cd8fee089576f4e43b Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 2 Mar 2013 10:28:19 +0100 Subject: [PATCH] fix crash on ASV accounts history --- modules/ing/browser.py | 4 ++++ modules/ing/pages/accounts_list.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/modules/ing/browser.py b/modules/ing/browser.py index 07eebae8..e5366bc6 100644 --- a/modules/ing/browser.py +++ b/modules/ing/browser.py @@ -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 = [] diff --git a/modules/ing/pages/accounts_list.py b/modules/ing/pages/accounts_list.py index 8da1768d..e518fed5 100644 --- a/modules/ing/pages/accounts_list.py +++ b/modules/ing/pages/accounts_list.py @@ -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