0

firstly-I apologize if I'm missing something super simple, I've looked at many questions and cannot find this out for the life of me.

Basically, the website I'm trying to gather text is here:

https://www.otcmarkets.com/stock/MNGG/overview

I want to pull the information from the side that says 'Dark or Defunct,' my current code is as follows:

url = 'https://www.otcmarkets.com/stock/MNGG/overview'
page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")
ticker = soup.find('href', 'Dark or Defunct')

But as the title says, it just returns none. Where am I going wrong? I'm quite inexperienced so I'd love an explanation if possible.

1 Answers1

0

It's returning none because it there is no mention of it in the HTML page source. Everything on that website is dynamically loaded from JavaScript sources. BeautifulSoup is designed to pull data out of HTML and XML files, and in the HTML file provided, there is no mention of "Dark or Darker" (so BeautifulSoup correctly finds nothing). You'll need to use a scraping method that has support for JavaScript. See Web-scraping JavaScript page with Python.

Matthew0898
  • 263
  • 2
  • 13