fix parsing accounts in particular cases
This commit is contained in:
parent
e229a730e7
commit
ac1a5b1efd
1 changed files with 8 additions and 3 deletions
|
|
@ -51,8 +51,13 @@ class AccountList(BasePage):
|
||||||
account.link_id = tmp.get("href")
|
account.link_id = tmp.get("href")
|
||||||
|
|
||||||
tmp = line.xpath("./td/span/strong")
|
tmp = line.xpath("./td/span/strong")
|
||||||
|
if len(tmp) >= 2:
|
||||||
tmp_id = tmp[0].text
|
tmp_id = tmp[0].text
|
||||||
tmp_balance = tmp[1].text
|
tmp_balance = tmp[1].text
|
||||||
|
else:
|
||||||
|
tmp_id = line.xpath("./td//span")[1].text
|
||||||
|
tmp_balance = tmp[0].text
|
||||||
|
|
||||||
account.id = tmp_id
|
account.id = tmp_id
|
||||||
account.balance = float(''.join(tmp_balance.replace('.','').replace(',','.').split()))
|
account.balance = float(''.join(tmp_balance.replace('.','').replace(',','.').split()))
|
||||||
self.account_list.append(account)
|
self.account_list.append(account)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue