I am building an application and i want to retrieve the latest quoted price from yahoo-finance. I am trying to scrape the path using BeautifulSoup, however all I get when I print is an empty list. Any suggestions?
Example HTML:
<span class="Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)" data-reactid="35"><!-- react-text: 36 -->169.37<!-- /react-text --></span>
My code:
import requests
from bs4 import BeautifulSoup
a = requests.get('https://finance.yahoo.com/quote/AAPL/history?p=AAPL')
soup = BeautifulSoup(a.content, 'lxml')
search = soup.find_all('span', {'class':'Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px)
D(ib)'})
print(search)