Commit 5b5ce050 authored by Dorian Roly's avatar Dorian Roly Committed by Vincent A

[BforBank] Add capability CapProfile to the module

I've implemented CapProfile to BforBank module.

the module is now able to scrape the personal information of the user under profile information.

I've applied the suggestions
parent 225775df
......@@ -30,7 +30,7 @@ from .pages import (
LoginPage, ErrorPage, AccountsPage, HistoryPage, LoanHistoryPage, RibPage,
LifeInsuranceList, LifeInsuranceIframe, LifeInsuranceRedir,
BoursePage, CardHistoryPage, CardPage, UserValidationPage, BourseActionNeeded,
BourseDisconnectPage, ProfilePage,
from .spirica_browser import SpiricaBrowser
......@@ -68,6 +68,7 @@ class BforbankBrowser(LoginBrowser):
bourse_titre = URL(r'', BoursePage) # to get logout link
bourse_disco = URL(r'', BourseDisconnectPage)
profile = URL(r'/espace-client/profil/informations', ProfilePage)
def __init__(self, birthdate, username, password, *args, **kwargs):
super(BforbankBrowser, self).__init__(username, password, *args, **kwargs)
......@@ -295,3 +296,8 @@ class BforbankBrowser(LoginBrowser):
def get_profile(self):
......@@ -21,6 +21,7 @@
from import Module, BackendConfig
from import CapBankWealth, AccountNotFound
from weboob.capabilities.base import find_object
from weboob.capabilities.profile import CapProfile
from import ValueBackendPassword, ValueDate
from .browser import BforbankBrowser
......@@ -28,7 +29,7 @@ from .browser import BforbankBrowser
__all__ = ['BforbankModule']
class BforbankModule(Module, CapBankWealth):
class BforbankModule(Module, CapBankWealth, CapProfile):
NAME = 'bforbank'
MAINTAINER = u'Baptiste Delpey'
......@@ -62,3 +63,6 @@ class BforbankModule(Module, CapBankWealth):
def iter_investment(self, account):
return self.browser.iter_investment(account)
def get_profile(self):
return self.browser.get_profile()
......@@ -30,6 +30,7 @@ from weboob.exceptions import ActionNeeded
from weboob.browser.pages import LoggedPage, HTMLPage, pagination, AbstractPage
from weboob.browser.elements import method, ListElement, ItemElement, TableElement
from import Account
from weboob.capabilities.profile import Person
from weboob.browser.filters.html import Link, Attr, TableCell
from weboob.browser.filters.standard import (
CleanText, Regexp, Field, Map, CleanDecimal, Date, Format,
......@@ -386,3 +387,24 @@ class BourseDisconnectPage(LoggedPage, HTMLPage):
if link:
m =
return m
class ProfilePage(LoggedPage, HTMLPage):
class get_profile(ItemElement):
klass = Person
obj_birth_date = Date(CleanText('//td[text()="Date de naissance"]/following::td[1]'))
obj_name = CleanText('//div[contains(@class,"tab-pane")]/table/thead/tr/th')
obj_nationality = CleanText('//td[text()="Nationalité(s)"]/following::td[1]')
obj_family_situation = CleanText('//td[text()="Situation Familiale"]/following::td[1]')
obj_email = CleanText('//td[text()="Adresse e-mail"]/following::td[1]')
obj_phone = CleanText('//td[text()="Téléphone portable"]/following::td[1]//td[1]')
obj_country = CleanText('//td[text()="Pays"]/following::td[1]')
obj_socioprofessional_category = CleanText('//td[text()="Situation professionnelle"]/following::td[1]')
obj_address = Format(
'%s %s %s',
CleanText('//td[text()="Code postal"]/following::td[1]'),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment