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_match_players doesn't load accurate passes #150

Closed christianlohr9 closed 2 years ago

christianlohr9 commented 2 years ago

Hi,

the fotmob_get_match_players function seems to have an issue. Last week everything worked fine, but this week e.g. the function doesn't fill the accurate_passes column.

The fotmob_get_season_stats for stat_name = "Accurate passes per 90" works just fine tho.

library(worldfootballR)
library(tidyverse)

fotmob_get_match_players(3552656) %>% select(id,stats_accurate_passes)
#> # A tibble: 44 × 2
#>    id      stats_accurate_passes
#>    <chr>                   <dbl>
#>  1 734689                     NA
#>  2 888650                     NA
#>  3 859026                     NA
#>  4 881818                     NA
#>  5 886252                     NA
#>  6 859030                     NA
#>  7 964595                     NA
#>  8 646026                     NA
#>  9 1204258                    NA
#> 10 271109                     NA
#> # … with 34 more rows
#> # ℹ Use `print(n = ...)` to see more rows
䀀싸覞Ǖ
#> Error in eval(expr, envir, enclos): object '䀀싸覞Ǖ' not found

Created on 2022-07-29 by the reprex package (v2.0.1)

For example Alexandra Popp (271109 last row in example) should have 13 accurate passes out of 29 touches.

image

Thanks for this awesome package, did some nice stuff with it!

Best regards, Christian

tonyelhabr commented 2 years ago

Thanks for the reprex! I can confirm that the NAs are un-intentional and should be fixed (see #152). You may recall better than I, but I don't think fotmob used to return the numbers in front of the percentage (13/29 in your example). This is what is causing the issue. The code was written expecting that only the percentage would be returned. I think fotmob may have changed this recently?