JSON parsing error, invalid character

I use fromJSONfrom package jsonlitein [R]to call GetPlayerSummariespasswords from the API ( https://developer.valvesoftware.com/wiki/Steam_Web_API ) to access user data. For most calls, it works fine, but at some point I get an error message:

    Error in feed_push_parser(readBin(con, raw(), n), reset = TRUE) : 
  lexical error: invalid bytes in UTF8 string.
          publicâ„¢ II: The Sith Lordsâ",               "gameid": "208580"          },
                     (right here) ------^ 

When I access the call in my browser, I find the place where it probably gives the error. I could try-catch, but I would really like to get this data. How to get around this?

+4
source share
2 answers

readLines, , ,

readlines <- readLines(link, warn = FALSE)
parse <- fromJSON(readlines)

, , , , , .

+2

jsonlite

 json_file <- stream_in(file("abc.json"))

Qaru :

JSON jsonlite

:

JSON Spark R

0

Source: https://habr.com/ru/post/1612140/


All Articles