'Not returning span-class through beatiful soup
I'm having a problem with requesting live data from an apple stock website:
When I import the HTML many "span's" are missing including the ones I need to get the live code
# Obter Informações Live
import requests
from bs4 import BeautifulSoup as BS
# URL DO JOGO
url='https://finance.yahoo.com/quote/AAPL?p=AAPL&.tsrc=fin-srch'
# Abre a página
r=requests.get(url)
soup= BS(r.text, 'lxml')
Apl = soup.find_all('fin-streamer', class_= "Fw(b) Fz(36px) Mb(-4px) D(ib)")
print(Apl)
Here is the console...
[<fin-streamer active="" class="Fw(b) Fz(36px) Mb(-4px) D(ib)" data-field="regularMarketPrice" data-pricehint="2" data-symbol="AAPL" data-test="qsp-price" data-trend="none" value="173.26">173.26</fin-streamer>]
Here's the HTML from the website
It's clear that the soup does not contain the span I want which is the ever changing live stock price... Why is this happening?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
