From e822f16980eb54d98327981ed2f3aa8dd8011f04 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 22 Jul 2015 09:58:56 +0200 Subject: [PATCH] credit mutuel: clean transactions label --- modules/creditmutuel/pages.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index 80b70efa..4877bd54 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -237,7 +237,15 @@ class OperationsPage(LoggedPage, HTMLPage): class OwnRaw(Filter): def __call__(self, item): - parts = [txt.strip() for txt in TableCell('raw')(item)[0].itertext() if len(txt.strip()) > 0] + el = TableCell('raw')(item)[0] + + # Remove hidden parts of labels: + # hideifscript: Date de valeur XX/XX/XXXX + # fd: Avis d'opéré + for sub in el.xpath('.//*[has-class("hideifscript") or has-class("fd")]'): + sub.drop_tree() + + parts = [txt.strip() for txt in el.itertext() if len(txt.strip()) > 0] # To simplify categorization of CB, reverse order of parts to separate # location and institution.