Remove (finally!) the index on ing / do not get coming operations

This commit is contained in:
Florent 2014-08-27 11:04:04 +02:00
commit 346c6efc6b
2 changed files with 3 additions and 10 deletions

View file

@ -105,21 +105,17 @@ 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
index = 0 # index, we get always the same page, but with more data
hashlist = [] hashlist = []
while True: while True:
i = index for transaction in self.page.get_transactions():
for transaction in self.page.get_transactions(index=index):
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()
hashlist.append(transaction.id) hashlist.append(transaction.id)
i += 1
yield transaction yield transaction
# if there is no more transactions, it is useless to continue # if there is no more transactions, it is useless to continue
if i == index or self.page.islast(): if self.page.islast():
return return
index = i
data = {"AJAX:EVENTS_COUNT": 1, data = {"AJAX:EVENTS_COUNT": 1,
"AJAXREQUEST": "_viewRoot", "AJAXREQUEST": "_viewRoot",
"autoScroll": "", "autoScroll": "",

View file

@ -133,7 +133,7 @@ class AccountsList(LoggedPage, HTMLPage):
@method @method
class get_transactions(ListElement): class get_transactions(ListElement):
item_xpath = '//table' item_xpath = '//div[@class="temporaryTransactionList"]//table'
class item(ItemElement): class item(ItemElement):
klass = Transaction klass = Transaction
@ -150,9 +150,6 @@ class AccountsList(LoggedPage, HTMLPage):
def condition(self): def condition(self):
if self.el.find('.//td[@class="date"]') is None: if self.el.find('.//td[@class="date"]') is None:
return False return False
if self.page.i < self.env['index']:
self.page.i += 1
return False
return True return True
def get_history_jid(self): def get_history_jid(self):