Fix history for saving accounts
This commit is contained in:
parent
2d08719789
commit
4c29f8a4cd
2 changed files with 10 additions and 2 deletions
|
|
@ -129,9 +129,13 @@ class IngBrowser(LoginBrowser):
|
||||||
self.logger.info('There is no history for this account')
|
self.logger.info('There is no history for this account')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if account.type == Account.TYPE_CHECKING:
|
||||||
|
history_function = self.page.get_transactions_cc
|
||||||
|
else:
|
||||||
|
history_function = self.page.get_transactions_others
|
||||||
hashlist = []
|
hashlist = []
|
||||||
while True:
|
while True:
|
||||||
for transaction in self.page.get_transactions():
|
for transaction in history_function():
|
||||||
transaction.id = hashlib.md5(transaction._hash).hexdigest()
|
transaction.id = hashlib.md5(transaction._hash).hexdigest()
|
||||||
while transaction.id in hashlist:
|
while transaction.id in hashlist:
|
||||||
transaction.id = hashlib.md5(transaction.id + "1").hexdigest()
|
transaction.id = hashlib.md5(transaction.id + "1").hexdigest()
|
||||||
|
|
|
||||||
|
|
@ -156,9 +156,13 @@ class AccountsList(LoggedPage, HTMLPage):
|
||||||
item_xpath = '//div[@class="transactions cc future"]//table'
|
item_xpath = '//div[@class="transactions cc future"]//table'
|
||||||
|
|
||||||
@method
|
@method
|
||||||
class get_transactions(generic_transactions):
|
class get_transactions_cc(generic_transactions):
|
||||||
item_xpath = '//div[@class="temporaryTransactionList"]//table'
|
item_xpath = '//div[@class="temporaryTransactionList"]//table'
|
||||||
|
|
||||||
|
@method
|
||||||
|
class get_transactions_others(generic_transactions):
|
||||||
|
item_xpath = '//table'
|
||||||
|
|
||||||
def get_history_jid(self):
|
def get_history_jid(self):
|
||||||
span = self.doc.xpath('//span[@id="index:panelASV"]')
|
span = self.doc.xpath('//span[@id="index:panelASV"]')
|
||||||
if len(span) > 1:
|
if len(span) > 1:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue