From 96bd0f67cbf30aeccca142f97aaad946d47ce5c6 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 22 Feb 2026 13:18:44 -0500 Subject: [PATCH] Create empty scrape_url function --- util/scrape.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 util/scrape.py diff --git a/util/scrape.py b/util/scrape.py new file mode 100644 index 0000000..8949394 --- /dev/null +++ b/util/scrape.py @@ -0,0 +1,27 @@ +""" + util/scrape.py + + Utility functions for scaping web data relative to selected games +""" + +import httpx +import pandas as pd +from bs4 import BeautifulSoup + + +def scrape_url(game: str, year: int | None) -> pd.DataFrame: + """ + Scrape game data from the url provided. This function requires specific environment variables be present + in order to function properly. + :param:game The target game to scrape. + :param:year The year to scrape. If no year is provided, scrapes games from the current year. + + :return: Pandas DataFrame + + Examples: + >>>scrape_url(game='mega-millions') + pd.DataFrame() + + >>>scrape_url(game='mega-millions', year=2020) + pd.DataFrame() + """