diff --git a/modules/bnporc/browser.py b/modules/bnporc/browser.py index 818880ee..bf7aebab 100644 --- a/modules/bnporc/browser.py +++ b/modules/bnporc/browser.py @@ -59,8 +59,8 @@ class BNPorc(BaseBrowser): # Pro 'https?://www.secure.bnpparibas.net/banque/portail/entrepros/Fiche\?.*identifiant=PRO_Une_Comptes.*': ProAccountsList, - 'https?://www.secure.bnpparibas.net/SAF_ROP\?Origine=DSP_HISTOCPT.*': ProAccountHistory, - 'https?://www.secure.bnpparibas.net/SAF_ROP\?Origine=DSP_ET.*': ProAccountHistory, + 'https?://www.secure.bnpparibas.net/SAF_ROP.*': ProAccountHistory, + 'https?://www.secure.bnpparibas.net/NS_AVEDT.*': ProAccountHistory, } def __init__(self, *args, **kwargs): @@ -203,9 +203,9 @@ class BNPorc(BaseBrowser): if account._stp is not None: # Pro - self.location(self.buildurl('/SAF_ROP', Origine='DSP_ET', ch4=account._link_id, stp=account._stp)) + self.location(self.buildurl('/NS_AVEDT', Origine='DSP_DT', ch4=account._link_id, stp=account._stp)) else: - # Persô + # Perso if not self.is_on_page(AccountsList): self.location('/NSFR?Action=DSP_VGLOBALE') diff --git a/modules/bnporc/pro.py b/modules/bnporc/pro.py index 878c335f..b7f4808b 100644 --- a/modules/bnporc/pro.py +++ b/modules/bnporc/pro.py @@ -106,4 +106,17 @@ class ProAccountHistory(BasePage): yield op def iter_coming_operations(self): - raise NotImplementedError() + for i, tr in enumerate(self.document.xpath('//tr[@class="hdoc1" or @class="hdotc1"]')): + cols = tr.findall('td') + + op = Transaction(i) + + date = self.parser.tocleanstring(cols[self.COL_DATE]) + raw = self.parser.tocleanstring(cols[self.COL_LABEL]) + raw = re.sub(r'[ \xa0]+', ' ', raw).strip() + op.parse(date=date, raw=raw) + + credit = self.parser.tocleanstring(cols[self.COL_CREDIT]) + op.set_amount(credit) + + yield op