def main(url):
# content of URL
r = requests.get(url)
# Parse HTML Code
soup = BeautifulSoup(r.text, 'html.parser')
print(soup.find_all('h1')
)
This code gets the html from a website using the Beautiful Soup Library & narrows it down. It returns:
[<h1 class="card-title pricing-card-title" id="ticker">Loading...</h1>]
When the website is opened in a browser, it has a random Ticker Symbol located in that line of html. However, when code is used to get the html, it has the word "Loading..." instead.
How do I use code to extract the randomly generated ticker symbol when opening the site?
I was expecting to get a random ticker symbol as one does when the website is opened normally. The website I am attempting to scrap is url = "https://www.rayberger.org/random-stock-picker/"