I want to scrape yahoo! finance and get the numerical value for "Net Assets" of any security:
import requests
from bs4 import BeautifulSoup
sii = "AGG"
url = "https://finance.yahoo.com/quote/%s?p=%s&.tsrc=fin-srch" % (sii, sii)
response = requests.get(url) # send request to yahoo!
soup = BeautifulSoup(response.text, "html.parser")
When I do this:
soup.find_all("span")
It returns:
[ <span data-reactid="53">Net Assets</span>,
<span class="Trsdu(0.3s) " data-reactid="55">72.72B</span>,]
My question is , how do I access the numerical value inside the last tag , eg. 72.72B ?