wiscostret / fplscrapR

This package enables those interested in Fantasy Premier League to perform detailed data analysis of the game, using the FPL's JSON API. The fplscrapR functions help R users collect and parse data from the Official Fantasy Premier League website.
Creative Commons Zero v1.0 Universal
77 stars 16 forks source link

parse_con error in get_player_details() #11

Closed dhaneswaramandrasa closed 3 years ago

dhaneswaramandrasa commented 4 years ago

Hello, at at the moment I've already installed the latest version of fplscrapR and find an error on get_player_details()

When I run,

get_player_details()

I got the following error:

Error in parse_con(txt, bigint_as_char) : parse error: premature EOF (right here) ------^

  1. | parse_con(txt, bigint_as_char)
  2. | parseJSON(txt, bigint_as_char)
  3. | parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  4. | jsonlite::fromJSON(url(paste("https://fantasy.premierleague.com/api/element-summary/", elements$id[i], "/", sep = "")))
  5. | ifelse(is.null(name), { detinfo <- data.frame() for (i in 1:nrow(elements)) { fplboot <- jsonlite::fromJSON(url(paste("https://fantasy.premierleague.com/api/element-summary/", ...
  6. | ifelse(is.null(playerid), ifelse(is.null(name), { detinfo <- data.frame() for (i in 1:nrow(elements)) { fplboot <- jsonlite::fromJSON(url(paste("https://fantasy.premierleague.com/api/element-summary/", ...
  7. | ifelse(!is.null(season), { detinfo <- read.csv(paste0("https://raw.githubusercontent.com/wiscostret/histfpldata/master/getplayerdetails", season, ".csv"), encoding = "UTF-8") ifelse(is.null(playerid), ifelse(is.null(name), return(detinfo), ...
  8. | get_player_details()

The same error occured when I run specific player, such as

get_player_details(name = "Mohamed Salah")

I've been looking for solution elsewhere but nothing works

I'm using R version 3.6.1 (2019-07-05) and MacOS 10.15.1

Thank you for your attention!

Dhanes

wiscostret commented 4 years ago

Hi, sorry for getting back to this late, was just reviewing issues again. Is this still a problem? Others have pointed out similar. But I wasn´t able to find an reproducible issue on the parsing.

wiscostret commented 3 years ago

Closing - expired.