Boursorama: load three months of history
This commit is contained in:
parent
5c3df70c50
commit
edcdd77e50
1 changed files with 14 additions and 3 deletions
|
|
@ -22,6 +22,8 @@
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
||||||
from weboob.backends.boursorama import pages
|
from weboob.backends.boursorama import pages
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
__all__ = ['boursorama']
|
__all__ = ['boursorama']
|
||||||
|
|
||||||
|
|
@ -78,9 +80,18 @@ class Boursorama(BaseBrowser):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_history(self, account):
|
def get_history(self, account):
|
||||||
if not self.is_on_page(pages.AccountHistory) or self.page.account.id != account.id:
|
self.location(account.link_id)
|
||||||
self.location(account.link_id)
|
operations = self.page.get_operations()
|
||||||
return self.page.get_operations()
|
# load last month as well
|
||||||
|
target = date.today() - relativedelta( months = 1 )
|
||||||
|
self.location(account.link_id + ("&month=%d&year=%d" % (target.month, target.year)))
|
||||||
|
operations += self.page.get_operations()
|
||||||
|
# and the month before, just in case you're greedy
|
||||||
|
target = date.today() - relativedelta( months = 2 )
|
||||||
|
self.location(account.link_id + ("&month=%d&year=%d" % (target.month, target.year)))
|
||||||
|
operations += self.page.get_operations()
|
||||||
|
|
||||||
|
return operations
|
||||||
|
|
||||||
def transfer(self, from_id, to_id, amount, reason=None):
|
def transfer(self, from_id, to_id, amount, reason=None):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue