I'm trying to make a bot that takes the data of btc prices from google and compares to another site but I can't find a way to make the numbers printed from html turn into a integer(So I can compare the numbers).
the error:
<ipython-input-37-58a648f164e1> in <module>()
11 tring = text.replace(" United States Dollar", "")
12
---> 13 tle = int(tring)
14
15 print(tle)
ValueError: invalid literal for int() with base 10: '43,020.80'
the code:
#make request to website
HTML = requests.get(url)
#parse the html
soup = BeautifulSoup(HTML.text, 'html.parser')
text = soup.find("div", attrs={'class':'BNeawe iBp4i AP7Wnd'}).find("div", attrs={'class':'BNeawe iBp4i AP7Wnd'}).text
tring = text.replace(" United States Dollar", "")
tle = int(tring)
print(tle)```