From 8f74aa8b3b6db35b3f7010be43750070f0263151 Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Wed, 2 Jan 2019 19:16:07 +0100 Subject: [PATCH] [creditmutuel] Fix card navigation With the async method, (thanks to creditmutuel website) the navigation were sometimes random to reach the good page in order to get the card type information. Consequently some immediate cards were still returned. Here we replace with the open method (will do step by step to reach the good page). Closes: 8831@zendesk --- modules/creditmutuel/pages.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index 6966ba1b22..580a8bee4c 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -1865,7 +1865,6 @@ def condition(self): obj_type = Account.TYPE_CARD obj__new_space = True obj__is_inv = False - load_details = Field('_link_id') & AsyncLoad def obj__secondpage(self): # Necessary to reach the good history page @@ -1909,8 +1908,8 @@ def obj__parent_id(self): def parse(self, el): # We have to reach the good page with the information of the type of card - async_page = Async('details').loaded_page(self) - card_type_page = Link('//div/ul/li/a[contains(text(), "Fonctions")]')(async_page.doc) + history_page = self.page.browser.open(Field('_link_id')(self)).page + card_type_page = Link('//div/ul/li/a[contains(text(), "Fonctions")]')(history_page.doc) doc = self.page.browser.open(card_type_page).page.doc card_type_line = doc.xpath('//tbody/tr[th[contains(text(), "Débit des paiements")]]') if card_type_line: -- GitLab