JaseZiv / worldfootballR

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

fotmob_get_matches_by_date() skips dates seemingly randomly #210

Closed cg86x closed 1 year ago

cg86x commented 1 year ago

dates
[1] "2022-11-09" "2022-11-10" "2022-11-11" "2022-11-12"

match_id_df <- fotmob_get_matches_by_date(dates) 

## results show no games for 2022-11-11 except for two midnight kickoffs in Brazil Serie A
## should show Empoli-Cremonses, Lyon-Nice, etc etc

Similar issues happen on other dates. Have not been able to figure out why they are being skipped.

tonyelhabr commented 1 year ago

after installing the latest development version of the package (like you did to address #209), does this work for you?

tonyelhabr commented 1 year ago

Just following up... this seems to work for me on 0.6.1.6000

library(worldfootballR)
packageVersion("worldfootballR")
#> [1] '0.6.1.6000'
dates <- as.Date(c("2022-11-09", "2022-11-10", "2022-11-11", "2022-11-12"))
fotmob_get_matches_by_date(dates)
#> # A tibble: 811 × 37
#>    ccode    id primary_id name   match…¹ match…² match…³ home_id home_…⁴ home_…⁵
#>    <chr> <int>      <int> <chr>    <int>   <int> <chr>     <int>   <int> <chr>  
#>  1 ESP      87         87 LaLiga 3918071      87 09.11.…    9865       0 Almeria
#>  2 ESP      87         87 LaLiga 3918077      87 09.11.…    8302       0 Sevilla
#>  3 ESP      87         87 LaLiga 3918070      87 09.11.…    8558       0 Espany…
#>  4 ESP      87         87 LaLiga 3918072      87 09.11.…    8661       0 Mallor…
#>  5 GER      54         54 Bunde… 3903664      54 09.11.…    8722       0 Köln   
#>  6 GER      54         54 Bunde… 3903665      54 09.11.…    9810       0 Frankf…
#>  7 GER      54         54 Bunde… 3903662      54 09.11.…  178475       0 RB Lei…
#>  8 GER      54         54 Bunde… 3903669      54 09.11.…   10189       0 Schalk…
#>  9 GER      54         54 Bunde… 3903663      54 09.11.…    8149       0 Union …
#> 10 ITA      55         55 Serie… 3919194      55 09.11.…    9888       0 Lecce  
#> # … with 801 more rows, 27 more variables: home_long_name <chr>, away_id <int>,
#> #   away_score <int>, away_name <chr>, away_long_name <chr>,
#> #   match_eliminated_team_id <lgl>, match_status_id <int>,
#> #   match_tournament_stage <chr>, match_status_started <lgl>,
#> #   match_status_cancelled <lgl>, match_status_finished <lgl>,
#> #   match_status_start_time_str <chr>, match_status_start_date_str <chr>,
#> #   match_status_start_date_str_short <chr>, match_status_score_str <chr>, …
cg86x commented 1 year ago

Yep after the updates that I did to resolve the other issue, this is now working. Thanks!