From 4c29f8a4cd8a1d9528dec43b3b422598d642712a Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 2 Sep 2014 15:23:32 +0200 Subject: [PATCH] Fix history for saving accounts --- modules/ing/browser.py | 6 +++++- modules/ing/pages/accounts_list.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/ing/browser.py b/modules/ing/browser.py index 4fd1726a..a7a00c7b 100644 --- a/modules/ing/browser.py +++ b/modules/ing/browser.py @@ -129,9 +129,13 @@ class IngBrowser(LoginBrowser): self.logger.info('There is no history for this account') return + if account.type == Account.TYPE_CHECKING: + history_function = self.page.get_transactions_cc + else: + history_function = self.page.get_transactions_others hashlist = [] while True: - for transaction in self.page.get_transactions(): + for transaction in history_function(): transaction.id = hashlib.md5(transaction._hash).hexdigest() while transaction.id in hashlist: transaction.id = hashlib.md5(transaction.id + "1").hexdigest() diff --git a/modules/ing/pages/accounts_list.py b/modules/ing/pages/accounts_list.py index f24a27f2..5a9f18fd 100644 --- a/modules/ing/pages/accounts_list.py +++ b/modules/ing/pages/accounts_list.py @@ -156,9 +156,13 @@ class AccountsList(LoggedPage, HTMLPage): item_xpath = '//div[@class="transactions cc future"]//table' @method - class get_transactions(generic_transactions): + class get_transactions_cc(generic_transactions): item_xpath = '//div[@class="temporaryTransactionList"]//table' + @method + class get_transactions_others(generic_transactions): + item_xpath = '//table' + def get_history_jid(self): span = self.doc.xpath('//span[@id="index:panelASV"]') if len(span) > 1: