Description Usage Arguments Value Examples
Scrape the tabular data from ESPN NBA website using RSelenium and returns a tibble of the data. Users can specify the seaason year and season type. User should also specify the port for Selenium driver. By default, the function will not write to csv until a string input for "csv_path" is given.
1 2 3 4 5 6 | nba_scraper(
season_year = 2018,
season_type = "regular",
port = 4445L,
csv_path = NULL
)
|
season_year |
int from 2001 to 2019 (upper limit based on latest year) |
season_type |
string. Either "regular" or "postseason" |
port |
int with L suffix. Must not be negative. |
csv_path |
string for csv file. Defaults to NULL. If specified, must end with ".csv". |
A tibble of scraped ESPN NBA data
1 2 3 4 5 6 7 8 | # Scrape regular season 2018/19 without saving to a csv file
nba_2018 <- nba_scraper(2018, season_type = "regular", port=4445L)
# Scrape playoffs season 2017/18 while saving to a local csv file.
nba_2017 <- nba_scraper(2017, season_type = "postseason",
port=4445L,
csv_path = "nba_2017_playoffs.csv")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.