boobank: updated transfer command for creditmutuel

Signed-off-by: Matthieu Weber <mweber+weboob@free.fr>
Signed-off-by: Romain Bignon <romain@symlink.me>
This commit is contained in:
Matthieu Weber 2015-02-06 20:16:22 +02:00 committed by Romain Bignon
commit c6b3309900
2 changed files with 49 additions and 20 deletions

View file

@ -69,7 +69,25 @@ class VerifCodePage(LoggedPage, HTMLPage):
class TransfertPage(LoggedPage, HTMLPage):
pass
def get_account_index(self, direction, account):
for div in self.doc.getroot().cssselect(".dw_dli_contents"):
inp = div.cssselect("input")[0]
if inp.name != direction:
continue
acct = div.cssselect("span.doux")[0].text.replace(" ", "")
if account.endswith(acct):
return inp.attrib['value']
else:
raise ValueError("account %s not found" % account)
def get_from_account_index(self, account):
return self.get_account_index('data_input_indiceCompteADebiter', account)
def get_to_account_index(self, account):
return self.get_account_index('data_input_indiceCompteACrediter', account)
def get_unicode_content(self):
return self.content.decode(self.detect_encoding())
class AccountsPage(LoggedPage, HTMLPage):