From 715b7bcd628cc97dbf4d5d79e20d3af9d28ae26a Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 24 Jul 2013 18:24:41 +0200 Subject: [PATCH] bnporc[ent]: Get all days in history --- modules/bnporc/enterprise/browser.py | 2 ++ modules/bnporc/enterprise/pages.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/modules/bnporc/enterprise/browser.py b/modules/bnporc/enterprise/browser.py index 6961d884..efbcd017 100644 --- a/modules/bnporc/enterprise/browser.py +++ b/modules/bnporc/enterprise/browser.py @@ -75,5 +75,7 @@ class BNPEnterprise(BaseBrowser): def iter_history(self, account): if not self.is_on_page(HistoryPage): self.location('/ROP?Action=F_RELCO&ch4=%s&ch8=2000' % account._link_id) + d1, d2 = self.page.get_date_range() + self.location('/ROP?Action=F_RELCO&ch4=%s&ch5=%s&ch9=%s&ch8=2000' % (account._link_id, d1, d2)) for transaction in self.page.iter_history(): yield transaction diff --git a/modules/bnporc/enterprise/pages.py b/modules/bnporc/enterprise/pages.py index 952b2a45..e7389d74 100644 --- a/modules/bnporc/enterprise/pages.py +++ b/modules/bnporc/enterprise/pages.py @@ -160,6 +160,12 @@ class HistoryPage(BEPage): if td.text_content().strip() == 'OPERATIONS': return table + def get_date_range(self): + radio = self.parser.select(self.document.getroot(), '//input[@name="br_tout_date"]', 1, 'xpath') + d1 = radio.attrib['value'][0:10] + d2 = radio.attrib['value'][10:20] + return (d1, d2) + def iter_history(self): if not self.is_empty(): table = self.find_table()