I use a screen scraper to get the value of my account balance, I would like to get 10% of that value but it gives this error: TypeError: can't multiply sequence by non-int of type 'float'. The code looks like this:
account_balance = driver.find_element_by_xpath("/html/body/div[1]/div/div[1]/div[2]/main/section/div/div[1]/section[2]/button[1]/span[1]")
account_balance_value = account_balance.get_attribute("title")
The value that it gives right now is
print(account_balance_value)
0,10
So I change it to this
account_balance_value = account_balance_value.replace(',', '.')
print(account_balance_value)
0.10
When I print this it gives the error:
print(account_balance_value * 0.1)
TypeError Traceback (most recent call last)
<ipython-input-102-536a3835612f> in <module>
----> 1 print(account_balance_value * 0.1)
TypeError: can't multiply sequence by non-int of type 'float'
If I just run this it's fine
print(0.10 * 0.1)
0.010000000000000002
What did I do wrong here?