= "https://stanfordclubsports.com/sports/cycling/roster/"
roster_url 0] get_roster(roster_url)[
{'title': 'Head Coach',
'name': 'Adrian Bennett',
'profile_url': 'https://stanfordclubsports.com/sports/cycling/roster/coaches/adrian-bennett/255'}
get_roster (roster_url:str)
Get a formatted Club Sports roster
Let’s try out this function with the Stanford Cycling team.
{'title': 'Head Coach',
'name': 'Adrian Bennett',
'profile_url': 'https://stanfordclubsports.com/sports/cycling/roster/coaches/adrian-bennett/255'}
get_staff (staff_url:str)
Get and format Club Sport staff
Let’s try this with the Stanford Cycling Team staff:
{'name': 'George Wehner',
'profile_url': 'https://stanfordclubsports.com/sports/cycling/roster/staff/george-wehner/18',
'title': 'President',
'email_address': 'gtwehner@stanford.edu',
'phone': ''}
get_academic_year ()
Helper to get the academic year
get_schedule (schedule_url:str, season:str=None, naive=False)
Get and parse a club sport schedule table.
Let’s try this out for the cycling schedule 2022-2023 season. This is the actual table from the Stanford Club Sports website:
Now we fetch the schedule and display the second row:
schedule = get_schedule("https://stanfordclubsports.com/sports/cycling/schedule", "2022-23")
schedule[1]
{'date': 'October 30, 2022 (Sunday)',
'time': '',
'at': 'Away',
'opponent': 'Surf City Cyclocross',
'location': 'Santa Cruz, CA',
'tv': '',
'radio': '',
'result': '4 Riders with Top 10 finishes',
'links': 'https://cyclo-x.com/results'}
Notice the links
field. It actually fetched the link. If we want to just get the cell contents, we can set naive=True
.
schedule = get_schedule("https://stanfordclubsports.com/sports/cycling/schedule", "2022-23", naive=True)
schedule[1]["links"]
'Event Results'
get_stories (home_url:str)
Get story blurbs from Club Sports website
Let’s try with a few different teams, like Stanford Cycling and Women’s Rugby.
[{'title': '2025 USA Cycling Collegiate Road National Championships',
'date': '2025-07-05T16:01:00',
'story_url': 'https://stanfordclubsports.com/news/2025/7/5/2025-usa-cycling-collegiate-road-national-championships.aspx',
'image_url': 'https://stanfordclubsports.com/images/2025/7/5/nationals.jpg',
'teaser': 'May 2-4, 2025'}]
[{'title': "Stanford Women's Rugby Crowned CRAA Challenger 7s National Champions",
'date': '2025-05-03T18:40:00',
'story_url': 'https://stanfordclubsports.com/news/2025/5/3/stanford-womens-rugby-crowned-craa-challenger-7s-national-champions.aspx',
'image_url': 'https://stanfordclubsports.com/images/2025/5/4/Natty_7s_SWR.jpeg',
'teaser': 'May 3, 2025'},
{'title': "Stanford Women's Rugby Advance to the Semi Finals in the CRAA 7s National Championship",
'date': '2025-05-02T20:54:00',
'story_url': 'https://stanfordclubsports.com/news/2025/5/2/stanford-womens-rugby-advance-to-the-semi-finals-in-the-craa-7s-national-championship.aspx',
'image_url': 'https://stanfordclubsports.com/images/2025/4/5/0J5A4952_copy.jpg',
'teaser': 'May 2, 2025'}]