From b5ffe7befb1312f8a7af887b8e8ce95c2c979a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Sobucki?= Date: Thu, 27 May 2021 16:30:25 +0200 Subject: [PATCH] [hsbc] Avoid false positive error messages commit 8087d2f6dea023946894032a8fde7c1bac6438ce added the handling of more error cases and a check for error messages at the `end_login()` step to fix `FormNotFound` errors. At this step, error messages and the message upon a succesful login are located under the same XPath. So, we might raise false login errors. To avoid false positives, we check whether we are logged in or not before handling errors. --- modules/hsbc/browser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hsbc/browser.py b/modules/hsbc/browser.py index 7f240ac348..9aaf061de6 100644 --- a/modules/hsbc/browser.py +++ b/modules/hsbc/browser.py @@ -227,7 +227,9 @@ def init_login(self): def end_login(self): for _ in range(3): if self.login.is_here(): - self.check_login_error() + if not self.page.logged: + # we should be logged in at this point + self.check_login_error() self.page.useless_form() # This wonderful website has 2 baseurl with only one difference: the 's' at the end of 'client' -- GitLab