Skip to content

Commit

Permalink
Merge pull request #391 from JaseZiv/fix-389-again
Browse files Browse the repository at this point in the history
  • Loading branch information
JaseZiv authored Jul 21, 2024
2 parents b9a9181 + 62a1ab4 commit fdbb082
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: worldfootballR
Title: Extract and Clean World Football (Soccer) Data
Version: 0.6.5.0007
Version: 0.6.5.0008
Authors@R: c(
person("Jason", "Zivkovic", , "[email protected]", role = c("aut", "cre", "cph")),
person("Tony", "ElHabr", , "[email protected]", role = "ctb"),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* `tm_player_bio()` not returning values in the `player_valuation`, `max_player_valuation` and `max_player_valuation_date` fields. Unfortunately, `max_player_valuation` and `max_player_valuation_date` fields are no able to be scraped at this release (0.6.5.0002) [#357](https://github.com/JaseZiv/worldfootballR/issues/357)
* `fb_league_stats()` not returning `player` table when hidden on page load. (0.6.5.0003) [#351](https://github.com/JaseZiv/worldfootballR/issues/351)
* Fix parameter mis-sepcification in fbref vignette. (0.6.5.0005) [#385](https://github.com/JaseZiv/worldfootballR/issues/385)
* `fb_season_team_stats()` failing due to change in FBRef table name. (0.6.5.0007) [#395](https://github.com/JaseZiv/worldfootballR/issues/389)
* `fb_season_team_stats()` failing due to change in FBRef table name. (0.6.5.0007, 0.6.5.0008) [#395](https://github.com/JaseZiv/worldfootballR/issues/389)

### Breaking Changes

Expand Down
8 changes: 1 addition & 7 deletions R/get_season_team_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,7 @@ fb_season_team_stats <- function(country, gender, season_end_year, tier, stat_ty
# have included this to differentiate between how different leagues handle ladders/tables
league_tables <- season_stats_page %>% rvest::html_nodes("#content .table_wrapper") %>% rvest::html_elements("h2") %>% rvest::html_text()

# we either want to detect the presence of League Table or Regular season and get the index of that to be able to extractg the table we want
if(length(grep(competition_name, league_tables)) > 0) {
league_tables_idx <- grep(competition_name, league_tables)
} else {
league_tables_idx <- grep("^Regular season", league_tables)
}

league_tables_idx <- 1

league_standings <- season_stats_page %>% rvest::html_nodes("table")

Expand Down

0 comments on commit fdbb082

Please sign in to comment.