support personnal accounts on professionnal website
This commit is contained in:
parent
27371fd7ed
commit
8dbcbf2daa
1 changed files with 14 additions and 1 deletions
|
|
@ -38,10 +38,13 @@ class ProAccountsList(BasePage):
|
||||||
COL_BALANCE = 3
|
COL_BALANCE = 3
|
||||||
COL_COMING = 5
|
COL_COMING = 5
|
||||||
|
|
||||||
def get_list(self):
|
def get_list(self, pro=True):
|
||||||
for tr in self.document.xpath('//tr[@class="comptes"]'):
|
for tr in self.document.xpath('//tr[@class="comptes"]'):
|
||||||
cols = tr.findall('td')
|
cols = tr.findall('td')
|
||||||
|
|
||||||
|
if len(cols) < 5:
|
||||||
|
continue
|
||||||
|
|
||||||
account = Account()
|
account = Account()
|
||||||
account.id = self.parser.tocleanstring(cols[self.COL_ID])
|
account.id = self.parser.tocleanstring(cols[self.COL_ID])
|
||||||
account.label = self.parser.tocleanstring(cols[self.COL_LABEL])
|
account.label = self.parser.tocleanstring(cols[self.COL_LABEL])
|
||||||
|
|
@ -63,6 +66,16 @@ class ProAccountsList(BasePage):
|
||||||
|
|
||||||
yield account
|
yield account
|
||||||
|
|
||||||
|
# If there are also personnal accounts linked, display the page and iter on them.
|
||||||
|
if pro and len(self.document.xpath('//div[@class="onglets"]//a[contains(@href, "afficherComptesPrives")]')) > 0:
|
||||||
|
self.browser.select_form(name='myForm')
|
||||||
|
self.browser.set_all_readonly(False)
|
||||||
|
self.browser['udcAction'] = '/afficherComptesPrives'
|
||||||
|
self.browser.submit()
|
||||||
|
|
||||||
|
for a in self.browser.page.get_list(False):
|
||||||
|
yield a
|
||||||
|
|
||||||
|
|
||||||
class ProAccountHistory(BasePage):
|
class ProAccountHistory(BasePage):
|
||||||
COL_DATE = 0
|
COL_DATE = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue