I'm trying to extract game stats of MLB games using BeautifulSoup. So far its been working well, but I just noticed that I'm unable to retrieve the information about the start time of the game using the usual way of doing so:
soup.findAll("span", {"class": "time game-time"})
What's weird about this is that it finds the exact element, and allows me to print it, and it shows that soup has found the all the contents of the element, except for the text. Unfortunately, the text part is all I need.
Images:
URL in question: http://www.espn.com/mlb/game?gameId=370925110
Is there any way around this issue without having to use a webdriver like Selenium?
Code:
with urllib.request.urlopen(link) as url:
page = url.read()
soup = BeautifulSoup(page, "html.parser")
clock = soup.findAll("span", {"class": "time game-time"})
print(clock[0])