I want to try to scrape stock prices from tradingview.com with python, however I am having a problem with the specific elements I am trying to scrape, the stock price constantly changes and so even when I inspect element and find the HTML element of the stock price the element content is also changing, when I try to request it with,
url = "https://www.tradingview.com/symbols/BTCCAD/?exchange=CAPITALCOM"
page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")
content = soup.find('div', class_ = 'tv-symbol-price-quote__value js-symbol-last')
print(content)
I just get an empty element,
<div class="tv-symbol-price-quote__value js-symbol-last"></div>
but on the webpage the html looks like this,
<div class="tv-symbol-price-quote__value js-symbol-last">
"5777"
<span class>2.47</span>
</div>
The content within the div element is constantly changing like every second.
So what is even going on here and how can I scrape the content within the element?