From 93ee2b5134030acfa6f2c6094baa721068b5eeaf Mon Sep 17 00:00:00 2001 From: Christophe Francois Date: Fri, 6 Nov 2020 15:19:39 +0100 Subject: [PATCH] [creditmutuel] Fix condition in iter market orders Rows with label 'Remboursement' were filtered out but it's not the only one that isn't a market order. Instead we filter out rows with no details link since market orders do have a link. --- modules/creditmutuel/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index 7cc2b6cd76..a1de55e8bf 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -1932,9 +1932,9 @@ class item(ItemElement): klass = MarketOrder def condition(self): - return 'Remboursement' not in CleanText('.')(self) + return Base(TableCell('direction'), Link('.//a', default=None))(self) is not None - obj_id = Base(TableCell('direction'), Regexp(Link('.//a'), r'ref=([^&]+)')) + obj_id = Base(TableCell('direction'), Regexp(Link('.//a', default=''), r'ref=([^&]+)', default=None)) obj_direction = Map( CleanText(TableCell('direction')), MARKET_ORDER_DIRECTIONS, -- GitLab