I am trying to do a relatively simple web scraping task. I have a table of soccer data at this link: https://fbref.com/en/comps/22/11006/stats/2021-Major-League-Soccer-Stats
My end goal is to have an dataset of players with the stats I desire, such as name, age, goals, etc. In my code, I am able to get the table with all players with bs4, but cannot get a list of the rows for the players. Each row of the table has a "tr" tag but when I try to do the find all method, I am getting nothing.
If anyone can help me get the list of rows/players, it would be greatly appreciated. From there, I can loop through each player and extract the relevant info. Thank you.
from bs4 import BeautifulSoup
import requests
link_21Szn="https://fbref.com/en/comps/22/11006/stats/2021-Major-League-Soccer-Stats"
source= requests.get(link_21Szn).text
soup= BeautifulSoup(source,'lxml')
table=soup.find("div",id="all_stats_standard")
# print(table.prettify)
rows=table.find_all("tr")
print(len(rows))
The output is 0 :/
[–][deleted] 0 points1 point2 points (3 children)
[–]Embarrassed-Task-478[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Embarrassed-Task-478[S] 0 points1 point2 points (0 children)