support CIF accounts
This commit is contained in:
parent
d36618a7b8
commit
15f536d09b
2 changed files with 19 additions and 2 deletions
|
|
@ -140,6 +140,9 @@ class BNPorc(BaseBrowser):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def iter_history(self, id):
|
def iter_history(self, id):
|
||||||
|
if id is None:
|
||||||
|
return iter([])
|
||||||
|
|
||||||
if not self.is_on_page(AccountsList):
|
if not self.is_on_page(AccountsList):
|
||||||
self.location('/NSFR?Action=DSP_VGLOBALE')
|
self.location('/NSFR?Action=DSP_VGLOBALE')
|
||||||
|
|
||||||
|
|
@ -178,6 +181,9 @@ class BNPorc(BaseBrowser):
|
||||||
return self.page.iter_operations()
|
return self.page.iter_operations()
|
||||||
|
|
||||||
def iter_coming_operations(self, id):
|
def iter_coming_operations(self, id):
|
||||||
|
if id is None:
|
||||||
|
return iter([])
|
||||||
|
|
||||||
if not self.is_on_page(AccountsList):
|
if not self.is_on_page(AccountsList):
|
||||||
self.location('/NSFR?Action=DSP_VGLOBALE')
|
self.location('/NSFR?Action=DSP_VGLOBALE')
|
||||||
execution = self.page.get_execution_id()
|
execution = self.page.get_execution_id()
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
import re
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
from weboob.capabilities.bank import Account
|
from weboob.capabilities.bank import Account
|
||||||
|
|
@ -50,12 +51,22 @@ class AccountsList(BasePage):
|
||||||
|
|
||||||
def _parse_account(self, tr):
|
def _parse_account(self, tr):
|
||||||
account = Account()
|
account = Account()
|
||||||
|
|
||||||
account.id = tr.xpath('.//td[@class="libelleCompte"]/input')[0].attrib['id'][len('libelleCompte'):]
|
account.id = tr.xpath('.//td[@class="libelleCompte"]/input')[0].attrib['id'][len('libelleCompte'):]
|
||||||
account._link_id = account.id
|
|
||||||
if len(str(account.id)) == 23:
|
if len(str(account.id)) == 23:
|
||||||
account.id = str(account.id)[5:21]
|
account.id = str(account.id)[5:21]
|
||||||
|
|
||||||
account.label = u''+tr.xpath('.//td[@class="libelleCompte"]/a')[0].text.strip()
|
a = tr.xpath('.//td[@class="libelleCompte"]/a')[0]
|
||||||
|
m = re.match(r'javascript:goToStatements\(\'(\d+)\'', a.get('onclick', ''))
|
||||||
|
if m:
|
||||||
|
account._link_id = m.group(1)
|
||||||
|
else:
|
||||||
|
# Can't get history for this account.
|
||||||
|
account._link_id = None
|
||||||
|
# To prevent multiple-IDs for CIF (for example), add an arbitrary char in ID.
|
||||||
|
account.id += 'C'
|
||||||
|
|
||||||
|
account.label = u''+a.text.strip()
|
||||||
|
|
||||||
tds = tr.findall('td')
|
tds = tr.findall('td')
|
||||||
account.balance = self._parse_amount(tds[3].find('a'))
|
account.balance = self._parse_amount(tds[3].find('a'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue