0
votes

I'd like to know how to get $39,465,077,974.88 from this beautifulsoup code

<td><span>$39,465,077,974.88</span><div><span class="sc-15yy2pl-0 kAXKAX" style="font-size:12px;font-weight:600"><span class="icon-Caret-up"></span>4.59<!-- -->%</span></div></td>

I'm new to web scrapers ????, hopefully you guys have a clear explanation.

1

1 Answers

1
votes

try using a css selector,

from bs4 import BeautifulSoup

soup = BeautifulSoup(html, "html.parser")

print(soup.select_one("td > span").text)

$39,465,077,974.88