JaseZiv / worldfootballR

A wrapper for extracting world football (soccer) data from FBref, Transfermark, Understat
https://jaseziv.github.io/worldfootballR/
464 stars 60 forks source link

fb_teams_urls returns teams not in competition when there are playoffs for promotion #344

Closed davecash75 closed 10 months ago

davecash75 commented 10 months ago

I was pulling the teams from the Eredivise using fb_teams_url, and it has a couple of teams from the 2nd tier who are on the league webpage, because they are listed through part of the playoffs page

{{Brief description of the problem}}

library(worldfootballR)
packageVersion("worldfootballR")

ned_season_urls <- fb_league_urls(country="NED",
                                  season_end_year=season_yr,
                                  gender="M",
                                  tier="1st")
ned_team_urls <- fb_teams_urls(ned_season_urls)
print(ned_team_urls)
sessionInfo()

Here is the output: [1] "https://fbref.com/en/squads/fb4ca611/2022-2023/Feyenoord-Stats"
[2] "https://fbref.com/en/squads/e334d850/2022-2023/PSV-Eindhoven-Stats"
[3] "https://fbref.com/en/squads/19c3f8c4/2022-2023/Ajax-Stats"
[4] "https://fbref.com/en/squads/3986b791/2022-2023/AZ-Alkmaar-Stats"
[5] "https://fbref.com/en/squads/a1f721d3/2022-2023/Twente-Stats"
[6] "https://fbref.com/en/squads/146a68ce/2022-2023/Sparta-Rotterdam-Stats" [7] "https://fbref.com/en/squads/2a428619/2022-2023/Utrecht-Stats"
[8] "https://fbref.com/en/squads/193ff7aa/2022-2023/Heerenveen-Stats"
[9] "https://fbref.com/en/squads/bb14adb3/2022-2023/RKC-Waalwijk-Stats"
[10] "https://fbref.com/en/squads/209d7fa2/2022-2023/Vitesse-Stats"
[11] "https://fbref.com/en/squads/e33d6108/2022-2023/Go-Ahead-Eagles-Stats" [12] "https://fbref.com/en/squads/fc629994/2022-2023/NEC-Nijmegen-Stats"
[13] "https://fbref.com/en/squads/bd08295c/2022-2023/Fortuna-Sittard-Stats" [14] "https://fbref.com/en/squads/8783f4ee/2022-2023/Volendam-Stats"
[15] "https://fbref.com/en/squads/740cb7d4/2022-2023/Excelsior-Stats"
[16] "https://fbref.com/en/squads/01888db1/2022-2023/Emmen-Stats"
[17] "https://fbref.com/en/squads/5c9e307a/2022-2023/Cambuur-Stats"
[18] "https://fbref.com/en/squads/bec05adb/2022-2023/Groningen-Stats"
[19] "https://fbref.com/en/squads/2b41acb5/2022-2023/Almere-City-Stats"
[20] "https://fbref.com/en/squads/534ac6d0/2022-2023/VVV-Venlo-Stats"
[21] "https://fbref.com/en/squads/8ed04be8/2022-2023/NAC-Breda-Stats"

Almere, VVV-Venlo, and NAC-Breda were not in the league...

Screenshot 2023-11-25 at 19 32 08

but they are in the playoff

Screenshot 2023-11-25 at 19 32 28
JaseZiv commented 10 months ago

Thanks for raising.

Should be a fairly easy fix. I will work on it over the coming days.

Thanks