eoppe1022 / elite

A Package for Scraping Hockey Data from EliteProspects
32 stars 14 forks source link

get_teams() purrr_error_rate_excess #5

Open gregalytics opened 5 years ago

gregalytics commented 5 years ago

In get_teams(): Getting a ton of message: Request failed after 10 attempts class: purrr_error_rate_excess

An example: teams_usdp <- get_teams("usdp", 2000:year(Sys.Date()))

dalesmidkiff commented 2 years ago

Second case: the get_player_stats_individual() shows the same error message.

purrr_error_rate_excess

trgreiss commented 2 years ago

The issue in get_player_stats_individual() is a result of an extra column in the results table that wasn't accounted for in purrr::set_names(). The player stats and goalie stats sections in this function should be modified to add a dummy column in set_names() to account for this:

rvest::html_node('[class="table table-striped table-sortable skater-stats highlight-stats"]') %>%
  rvest::html_table() %>%
  purrr::set_names("number","dummy", "name", "games_played", "goals", "assists", "points", "penalty_minutes", "plus_minus", "blank", "games_played_playoffs", "goals_playoffs", "assists_playoffs", "points_playoffs", "penalty_minutes_playoffs", "plus_minus_playoffs") %>%