So far I have the following code, I'm including all of it in case it helps
import requests
from bs4 import BeautifulSoup
URL = 'https://projects.fivethirtyeight.com/2020-nba-predictions/games/'
page = requests.get(URL)
soup = BeautifulSoup(page.content, 'html.parser')
todays_games = soup.find('div', class_="games-section extra-space-0")
stats = []
for games in len(list(todays_games.children)):
game = list(todays_games.children)[games]
and the error I am getting is
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-39f21f5da0b0> in <module>
1 #This is the main new feature of this version. A for loop to perform the operation for all the games of that day
2 stats = []
----> 3 for games in len(list(todays_games.children)):
4 game = list(todays_games.children)[games]
5 game_body = game.body
TypeError: 'int' object is not iterable
If I do type() on list(todays_games.children) and Len(list(todays_games.children)) I get "list" and the length, which happens to be 6 for this particular case on this particular day, So I don't understand why I am getting this error. Any Ideas?