The new woob repository is here: This gitlab will be removed soon.

Commit 14c6f915 authored by Damien Mat's avatar Damien Mat Committed by Vincent A

[hsbc] handle user locked

Detected after username submission.
Since we weren't handling this case, login was proceeding
to 2FA notification instead of stopping here.
parent d3c2bdf3
......@@ -32,7 +32,7 @@
from import sorted_transactions, keep_only_card_transactions
from import parse_qsl, urlparse
from import Value
from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable, BrowserQuestion
from weboob.exceptions import ActionNeeded, BrowserIncorrectPassword, BrowserUnavailable, BrowserQuestion
from weboob.browser import URL, need_login, TwoFactorBrowser
from weboob.browser.exceptions import HTTPNotFound
from weboob.capabilities.base import find_object
......@@ -190,6 +190,12 @@ def init_login(self):
if no_secure_key_link:
error =
if error and 'Please click Reset Credentials' in error:
raise ActionNeeded(error)
elif error:
raise AssertionError('Unhandled error at login: %s' % error)
raise BrowserQuestion(
......@@ -554,6 +554,9 @@ def login(self, login):
form['userid'] = form['__hbfruserid'] = login
def get_error(self):
return CleanText('//div[contains(@class, "PanelMsgGroup")]')(self.doc)
def get_no_secure_key_link(self):
a = self.doc.xpath('//a[contains(text(), "Without HSBC Secure Key")]')[0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment