From 2ddf8f66b9e068199d470cf65d567d57a66e8a97 Mon Sep 17 00:00:00 2001 From: Florent Date: Sat, 26 Jan 2013 13:47:10 +0100 Subject: [PATCH] Take the operation id of the bank --- modules/boursorama/browser.py | 2 -- modules/boursorama/pages/account_history.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/boursorama/browser.py b/modules/boursorama/browser.py index 3f09fd8d..250ee4a8 100644 --- a/modules/boursorama/browser.py +++ b/modules/boursorama/browser.py @@ -95,8 +95,6 @@ class Boursorama(BaseBrowser): target = date.today() - relativedelta(months=2) self.location(account._link_id + ("&month=%d&year=%d" % (target.month, target.year))) operations += self.page.get_operations() - for index, op in enumerate(operations): - op.id = index return operations diff --git a/modules/boursorama/pages/account_history.py b/modules/boursorama/pages/account_history.py index d51a6521..871da3c9 100644 --- a/modules/boursorama/pages/account_history.py +++ b/modules/boursorama/pages/account_history.py @@ -57,6 +57,7 @@ class AccountHistory(BasePage): # tds[1]: valeur d = date(*reversed([int(x) for x in tds[1].text.split('/')])) labeldiv = tds[2].find('div') + inputid = tds[5].find('input[@type="hidden"]') label = u'' label += labeldiv.text if labeldiv.find('a') is not None: @@ -69,7 +70,7 @@ class AccountHistory(BasePage): debit = tds[3].text or "" credit = tds[4].text or "" - operation = Transaction(len(self.operations)) + operation = Transaction(inputid.attrib['id'].split('_')[1]) operation.parse(date=d, raw=label) operation.set_amount(credit, debit) operation.category = category