我正在开发一个 Python3 程序,该程序使用 Selenium 在 Chrome 中打开网络浏览器,然后导航到美国银行账户信息页面。但是,我无法从包含美元符号的字符串中提取实际帐户余额。
我想从帐户余额中提取值并存储没有美元符号的数字。我该怎么做?
from selenium import webdriver
... # Logins in & navigates to account info
balanceValue = browser.find_element_by_class_name('AccountBalance')
balanceValue = balanceValue.text
print(balanceValue)
$415.24
# I want the following output without the dollar sign
print(balanceValue)
415.24
跃然一笑
青春有我
相关分类