Commit cee58456 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[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
parent 5cd95af6
......@@ -69,7 +69,8 @@ class ProAccountsList(LoggedPage, MyHTMLPage):
a.type = account_type = unicode('([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 ' %, ''))
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'
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