ryurko / fcscrapR

R package to scrape soccer commentary and statistics from ESPN
28 stars 11 forks source link

Issue with scrape_commentary and scrape_scoreboard_ids #10

Open hexolite opened 2 years ago

hexolite commented 2 years ago

Hi, I tried to use your package that looks awesome but I'm unable to get it to work.

I have an issue with the scrape_commentary function that, for any given ID, returns:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘pillar’ 1.5.0 is being loaded, but >= 1.5.1 is required

Also, when I try to use scrape_scoreboard_ids for any league/date combination, I end up having:

"No matches available for xxx on yyyy-mm-dd"

Any help? Thanks

hexolite commented 2 years ago

Sorry, the first issue is my mistake.

For the second issue, I think I found the solution. ESPN FC URLs have changed since you developed the package I guess and the URL in the scrape_scoreboard_ids() function is messing things up. Here are the changes I made in a custom function from your function code found here: https://github.com/ryurko/fcscrapR/blob/master/R/scrape_game_ids.R.

becomes

stringr::strdetect("\"http://www.espn.com/soccer/match//gameId/[0-9]{6}\"")

becomes

stringr::str_extractall("\"http://www.espn.com/soccer/match//gameId/[0-9]{6}\"") %>%

becomes

teams <- paste0("http://www.espn.com/soccer/match/_/gameId/", x) %>%

Hope this may help. Thanks again for the good work 👍