From cee58456b5087d41968252636487304db9e53deb Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 15 May 2019 18:58:32 +0200 Subject: [PATCH] [bp] Exclude HTML comments in the account tmp_balance Some connections are in crash because there are comments in the 'td' tag of the balance: using .text_content() solves the issue and return the correct balance. Closes: 41316@sibi --- modules/bp/pages/pro.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/bp/pages/pro.py b/modules/bp/pages/pro.py index f80e4a9b68..a2882ac981 100644 --- a/modules/bp/pages/pro.py +++ b/modules/bp/pages/pro.py @@ -69,7 +69,8 @@ def get_accounts_list(self): a.type = account_type a.id = unicode(re.search('([A-Z\d]{4}[A-Z\d\*]{3}[A-Z\d]{4})', link.attrib['title']).group(1)) a.label = unicode(link.attrib['title'].replace('%s ' % a.id, '')) - tmp_balance = CleanText(None).filter(cols[1]) + # We use '.text_content()' to avoid HTML comments like '' + tmp_balance = CleanText(None).filter(cols[1].text_content()) a.currency = a.get_currency(tmp_balance) if not a.currency: a.currency = u'EUR' -- GitLab