I'm trying to scrape data from an interactive graph using r. So this is the url:
https://docs.google.com/spreadsheets/d/e/2PACX-1vQjDUQorXKZF9xsM6iR5Vl6oEc14uBj0g73arQdVAoQiWsppdFeaHpM0exftRlpCBGo591KVrFra_eF/pubchart?oid=1364851531&format=interactive
This is my code:
> library(jsonlite)
> library(httr)
> url <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vQjDUQorXKZF9xsM6iR5Vl6oEc14uBj0g73arQdVAoQiWsppdFeaHpM0exftRlpCBGo591KVrFra_eF/pubchart?oid=1364851531&format=interactive"
> req <- GET(url)
> stop_for_status(req)
> json <- content(req, "text")
> mydata <- fromJSON(json)
And I got this error message:
Error: lexical error: invalid char in json text.
<meta name="referre
(right here) ------^
Is there another way to get the data from the interactive plot? Thank you in advance.