Fix LCL backend (site change ?)

Signed-off-by: Luc Didry <luc@didry.org>
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Luc Didry 2011-10-11 00:22:50 +02:00 committed by Romain Bignon
commit 2eacb056c1
2 changed files with 6 additions and 6 deletions

View file

@ -37,7 +37,7 @@ class LCLBrowser(BaseBrowser):
'https://particuliers.secure.lcl.fr/everest/UWBI/UWBIAccueil\?DEST=IDENTIFICATION': LoginResultPage, 'https://particuliers.secure.lcl.fr/everest/UWBI/UWBIAccueil\?DEST=IDENTIFICATION': LoginResultPage,
'https://particuliers.secure.lcl.fr/outil/UWSP/Synthese/accesSynthese': AccountsPage, 'https://particuliers.secure.lcl.fr/outil/UWSP/Synthese/accesSynthese': AccountsPage,
'https://particuliers.secure.lcl.fr/outil/UWB2/Accueil\?DEST=INIT': FramePage, 'https://particuliers.secure.lcl.fr/outil/UWB2/Accueil\?DEST=INIT': FramePage,
'https://particuliers.secure.lcl.fr/outil/UWLM/ListeMouvementsPro/accesListeMouvementsPro.*': AccountHistoryPage, 'https://particuliers.secure.lcl.fr/outil/UWLM/ListeMouvementsPar/accesListeMouvementsPar.*': AccountHistoryPage,
} }
def __init__(self, agency, *args, **kwargs): def __init__(self, agency, *args, **kwargs):

View file

@ -55,7 +55,7 @@ class AccountsPage(BasePage):
def get_list(self): def get_list(self):
l = [] l = []
for div in self.document.getiterator('div'): for div in self.document.getiterator('div'):
if div.attrib.get('class')=="unCompte-CC" : if div.attrib.get('class')=="unCompte-CD" or div.attrib.get('class')=="unCompte-CE":
account = Account() account = Account()
account.id = div.attrib.get('id').replace('-','') account.id = div.attrib.get('id').replace('-','')
for td in div.getiterator('td'): for td in div.getiterator('td'):
@ -77,7 +77,7 @@ class AccountHistoryPage(BasePage):
text=td.findtext("b") text=td.findtext("b")
if text is None: if text is None:
continue continue
prefix='Opérations effectuées' prefix='Solde au'
if text.startswith(prefix.decode('utf-8')): if text.startswith(prefix.decode('utf-8')):
table=td.getparent().getparent() table=td.getparent().getparent()
for tr in table.iter('tr'): for tr in table.iter('tr'):
@ -86,10 +86,10 @@ class AccountHistoryPage(BasePage):
tds=tr.findall('td') tds=tr.findall('td')
d=date(*reversed([int(x) for x in tds[0].text.split('/')])) d=date(*reversed([int(x) for x in tds[0].text.split('/')]))
label=u''+tds[1].find('a').text.strip() label=u''+tds[1].find('a').text.strip()
if tds[3].text.strip() != u"": if tds[2].text.strip() != u"":
amount = - float(tds[3].text.strip().replace('.','').replace(',','.').replace(u"\u00A0",'').replace(' ','')) amount = - float(tds[2].text.strip().replace('.','').replace(',','.').replace(u"\u00A0",'').replace(' ',''))
else: else:
amount= float(tds[4].text.strip().replace('.','').replace(',','.').replace(u"\u00A0",'').replace(' ','')) amount= float(tds[3].text.strip().replace('.','').replace(',','.').replace(u"\u00A0",'').replace(' ',''))
operation=Operation(len(self.operations)) operation=Operation(len(self.operations))
operation.date=d operation.date=d
operation.label=label operation.label=label