0

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?

  • 1
    Does this answer your question? [How to retrieve the values of dynamic html content using Python](https://stackoverflow.com/questions/17597424/how-to-retrieve-the-values-of-dynamic-html-content-using-python) – Axisnix Aug 11 '21 at 20:12
  • Well no, I am asking what is happening in my question as I do not understanding what is going on, this is not a repeat how do I take that tag off this question I'm just looking for an answer. –  Aug 11 '21 at 20:53

0 Answers0