This is actually the same case (no "a" in coming).
The code should never crash now.
This commit is contained in:
parent
444a2a9971
commit
481226c6d0
1 changed files with 6 additions and 9 deletions
|
|
@ -51,17 +51,14 @@ class AccountsList(BasePage):
|
||||||
balance = balance.replace('.','').replace(',','.')
|
balance = balance.replace('.','').replace(',','.')
|
||||||
account.balance = float(balance)
|
account.balance = float(balance)
|
||||||
elif td.attrib.get('headers', '').startswith('Avenir'):
|
elif td.attrib.get('headers', '').startswith('Avenir'):
|
||||||
|
a = td.findall('a')
|
||||||
# Some accounts don't have a "coming"
|
# Some accounts don't have a "coming"
|
||||||
if td.text.strip() == '-':
|
if len(a):
|
||||||
account.coming = 0.0
|
coming = a[0].text
|
||||||
|
coming = coming.replace('.','').replace(',','.')
|
||||||
|
account.coming = float(coming)
|
||||||
else:
|
else:
|
||||||
a = td.findall('a')
|
account.coming = 0.0
|
||||||
if len(a) == 0:
|
|
||||||
account.coming = 0.0
|
|
||||||
else:
|
|
||||||
coming = a[0].text
|
|
||||||
coming = coming.replace('.','').replace(',','.')
|
|
||||||
account.coming = float(coming)
|
|
||||||
|
|
||||||
l.append(account)
|
l.append(account)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue