dcstats / CBBpy

A Python-based web scraper for NCAA basketball.
MIT License
11 stars 2 forks source link

get_game_ids doesn't work when called independently with a string as argument #6

Closed dcstats closed 2 years ago

dcstats commented 2 years ago

Code

ms.get_game_ids('2020-12-26')

Exception

File /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/cbbpy/mens_scraper.py:463, in get_game_ids(date)
    453 def get_game_ids(date: str) -> list:
    454     """A function that scrapes all game IDs on a date.
    455 
    456     Parameters:
   (...)
    460         - a list of ESPN all game IDs for games played on the date given
    461     """
--> 463     d = date.strftime("%Y%m%d")
    464     url = SCOREBOARD_URL.format(d)
    465     page = r.get(url)

AttributeError: 'str' object has no attribute 'strftime'

Expected behavior

The function should be able to accept a properly formatted date as a string and return a list of all the game IDs on that day