Create empty scrape_url function
This commit is contained in:
1 parent
c879f13c4f
commit
96bd0f67cb
1 file changed
+27
@@ -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()
|
||||
"""
|
||||
Reference in new issue
Block a user