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

Player market values showing as NA using the tm_player_bio helper function #109

Closed aaronwoodward1 closed 2 years ago

aaronwoodward1 commented 2 years ago

Hello,

First, I just wanted to express gratitude for this package. I have been trying to scrape and merge together fbref and transfermarkt data for almost two years. This package has been terrific and fun to use, so thank you.

Recently, when using the tm_player_bio helper function, the player_valuation field shows "NA". This could be due to the changing behavior of the Transfermarkt website. Is there something that I need to do on my end to resolve this issue.

Again, thank you for the package!

JaseZiv commented 2 years ago

Hi there @aaronwoodward1,

Thanks for reaching out.

Can you please provide the code you used that returned this issue? Also provide the output of sessionInfo().

Thanks

aaronwoodward1 commented 2 years ago

Hey @JaseZiv,

As an example, this is a snippet of code, that I would execute with a the tm_player_bio helper function:

player_tm <- tm_player_bio("https://www.transfermarkt.com/christian-eriksen/profil/spieler/69633").

Also here's the output of sessionInfo():

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.6

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] glue_1.6.2 ggtext_0.1.1 worldfootballR_0.5.1.1000 [4] xml2_1.3.3 janitor_2.1.0 rvest_1.0.2
[7] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.8
[10] purrr_0.3.4 readr_2.1.2 tidyr_1.2.0
[13] tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1

loaded via a namespace (and not attached): [1] progress_1.2.2 tidyselect_1.1.2 haven_2.4.3 snakecase_0.11.0 colorspace_2.0-2 [6] vctrs_0.4.0 generics_0.1.2 utf8_1.2.2 rlang_1.0.2 gridtext_0.1.4
[11] pillar_1.7.0 withr_2.5.0 DBI_1.1.1 selectr_0.4-2 dbplyr_2.1.1
[16] modelr_0.1.8 readxl_1.3.1 lifecycle_1.0.1 munsell_0.5.0 gtable_0.3.0
[21] cellranger_1.1.0 labeling_0.4.2 tzdb_0.3.0 curl_4.3.2 fansi_1.0.3
[26] broom_0.7.10 Rcpp_1.0.7 scales_1.1.1 backports_1.3.0 jsonlite_1.8.0
[31] farver_2.1.0 fs_1.5.0 digest_0.6.28 hms_1.1.1 stringi_1.7.6
[36] grid_4.1.2 cli_3.2.0 tools_4.1.2 magrittr_2.0.3 crayon_1.5.1
[41] pkgconfig_2.0.3 ellipsis_0.3.2 prettyunits_1.1.1 reprex_2.0.1 lubridate_1.8.0
[46] assertthat_0.2.1 httr_1.4.2 rstudioapi_0.13 R6_2.5.1 compiler_4.1.2

Thanks for your prompt response!

JaseZiv commented 2 years ago

Thanks heaps.

Yep, looks like their site must have changed slightly, causing both the player_name and player_valuation columns to be wrong.

Will fix over the next few days.

JaseZiv commented 2 years ago

This has been fixed in v0.1.5.4000.

Install the dev version using devtools::install_github("JaseZiv/worldfootballR").

You'll notice two new columns, one for the maximum value the player was assigned in their career, and on what date.

Hope you enjoy!

aaronwoodward1 commented 2 years ago

Wow! That was fast! Thanks so much @JaseZiv!