From 57f92d61f74336de30157403d945c38f4b52070e Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Thu, 21 Feb 2019 17:12:16 +0100 Subject: [PATCH] [creditdunord] Fix iter account During the get_labels, we can have "Comptes et cartes" and "Comptes et Cartes"...... We compare now with lower method. Closes: 37018@sibi --- modules/creditdunord/pages.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/creditdunord/pages.py b/modules/creditdunord/pages.py index 1a5a98d3cb..879d1ab77e 100755 --- a/modules/creditdunord/pages.py +++ b/modules/creditdunord/pages.py @@ -29,7 +29,7 @@ from weboob.browser.pages import HTMLPage, LoggedPage, JsonPage from weboob.browser.elements import method, ItemElement, TableElement -from weboob.browser.filters.standard import CleanText, Date, CleanDecimal, Regexp, Format, Field, Eval +from weboob.browser.filters.standard import CleanText, Date, CleanDecimal, Regexp, Format, Field, Eval, Lower from weboob.browser.filters.json import Dict from weboob.browser.filters.html import Attr, TableCell from weboob.exceptions import ActionNeeded, BrowserIncorrectPassword, BrowserUnavailable, BrowserPasswordExpired @@ -172,15 +172,15 @@ def on_load(self): raise ActionNeeded() def get_labels(self): - synthesis_labels = ["Synthèse"] - loan_labels = ["Crédits en cours", "Crédits perso et immo", "Crédits", "Crédits Personnels et immobiliers"] - keys = [key for key in Dict('donnees')(self.doc) if key.get('label') in ['Crédits', 'Comptes et cartes']] + synthesis_labels = ["synthèse"] + loan_labels = ["crédits en cours", "crédits perso et immo", "crédits", "crédits personnels et immobiliers"] + keys = [key for key in Dict('donnees')(self.doc) if key.get('label').lower() in ['crédits', 'comptes et cartes']] for key in keys: for element in Dict('submenu')(key): - if CleanText(Dict('label'))(element) in synthesis_labels: + if Lower(CleanText(Dict('label')))(element) in synthesis_labels: synthesis_label = CleanText(Dict('link'))(element).split("/")[-1] - if CleanText(Dict('label'))(element) in loan_labels: - loan_label = CleanText(Dict('link'))(element).split("/")[-1] + if CleanText(Dict('label'))(element).lower() in loan_labels: + loan_label = Lower(CleanText(Dict('link')))(element).split("/")[-1] return (synthesis_label, loan_label) -- GitLab