From 141cf0ada5dfca19ebddb71e5c491a502ef3e3e4 Mon Sep 17 00:00:00 2001 From: Tony ElHabr Date: Sat, 20 Jul 2024 17:18:57 -0500 Subject: [PATCH 1/2] always choose the first table --- R/get_season_team_stats.R | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/R/get_season_team_stats.R b/R/get_season_team_stats.R index b23d6ac7..e90e05ca 100644 --- a/R/get_season_team_stats.R +++ b/R/get_season_team_stats.R @@ -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") From 62a1ab46a8e82034633d7614fe9e0ad919d933dd Mon Sep 17 00:00:00 2001 From: Tony ElHabr Date: Sun, 21 Jul 2024 06:41:49 -0500 Subject: [PATCH 2/2] bump version --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3e3ef799..6b25d180 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", , "jaseziv83@gmail.com", role = c("aut", "cre", "cph")), person("Tony", "ElHabr", , "anthonyelhabr@gmail.com", role = "ctb"), diff --git a/NEWS.md b/NEWS.md index 3d4e9c3b..ab332917 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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