1
I want to extract a JSON content from a website and convert it into a dataframe
Website is https://schutz-shoes.com/products/amaia-sandal-metallic-leather?color=ouro%20gold
Inside that site, squeezing F12
, and going into Network
, get a link to the API that brings the price of the product, given in the link below
https://schutz-shoes.com/tools/verge-json-ld?url=https://schutz-shoes.com/products/amaia-sandal-metallic-leather?color=ouro%20gold
That’s the API I want to extract content from JSON
for a data.frame
I tried the following method
library(httr)
library(jsonlite)
a<-GET("https://schutz-shoes.com/tools/verge-json-ld?url=https://schutz-shoes.com/products/amaia-sandal-metallic-leather?color=ouro%20gold")
a<-content(a,"text")
b<-fromJSON(a)
But I get the following error
Error in parse_con(txt, bigint_as_char) :
lexical error: invalid character inside string.
ail and walk-able chunky heel. Material: Metallic Leather H
(right here) ------^
I’d like to get around the mistake, but I don’t know the source of the problem.
Good to know the problem has a solution.
– Marcus Nunes