From 8fa795efc1c8613d55a33346bb120033cdf0cdba Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 16 Sep 2020 17:12:21 +0200 Subject: [PATCH] [cragr] Handle netfinca action needed before checking if account is present The xpath to check if an account is present does not appear if the netfinca space is in action needed so I added a check_action_needed method that is used for iter_investments and iter_market_orders. --- modules/cragr/browser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/cragr/browser.py b/modules/cragr/browser.py index f6c28e8a77..9321eb0ae5 100644 --- a/modules/cragr/browser.py +++ b/modules/cragr/browser.py @@ -830,6 +830,7 @@ def iter_investment(self, account): self.location(url) self.netfinca.session.cookies.update(self.session.cookies) self.netfinca.accounts.go() + self.netfinca.check_action_needed() for inv in self.netfinca.iter_investments(account): if inv.code == 'XX-liquidity' and account.type == Account.TYPE_PEA: # Liquidities are already fetched on the "PEA espèces" @@ -856,6 +857,7 @@ def iter_market_orders(self, account): # This avoids unnecessary logouts and saves a lot of requests, but only # works if the accounts are on the same perimeter. self.netfinca.accounts.go() + self.netfinca.check_action_needed() if self.netfinca.is_account_present(account.id): for order in self.netfinca.iter_market_orders(account): yield order -- GitLab