page=requests.get(url).text
table_attribs=["Name","mc_usd_millions"]
df=pd.DataFrame(columns=table_attribs)
data=BeautifulSoup(page,'html.parser')
tables=data.find_all('tbody')
rows=tables[1].find_all('tr')
for row in rows:
col=row.find_all("td")
if len(col)!=0:
if col[1].find("a") is not None:
data_dict={"bank_name":col[1].find_all('a')[1].contents[0],
"market_cap":float(col[2].contents[0][:-1]) }
I am tring to scrape data from a website into a dictionary and load it to a dataframe but I keep on running into this error
ValueError: could not convert string to float: '5,742.86'
I was expecting the program to convert the number from a string to a float.