How to read JSON from HTML?



I know we can use Requests.jl to get the data, but I am not sure how we can parse the JSON with JSON.jl:

using Requests, JSON

r = get("")
parse( # should JSON.Parser.parse work here?


I think you should probably try HTTP.jl

I don’t think Requests is recommended or actively maintained
quoting malmaud the biggest contributor

I think HTTP.jl is probably the future of the Julia we stack. Would be
awesome to get it merged there.


@musm my choice for Requests.jl over HTTP.jl was based on the number of stars on GitHub (100 vs. 19), could you please confirm HTTP.jl is the future?


I can’t predict the future but here is the original quote


The answer with HTTP.jl:

using HTTP, JSON

resp = HTTP.get("")
str = String(resp.body)
jobj = JSON.Parser.parse(s)


@juliohm, should it be JSON.parse(str) * ?


@miguelraz I don’t remember what happened, but I had to use JSON.Parser.parse(str) instead as I wrote on my answer. Maybe it has changed since then.


JSON.parse should work, but will not autocomplete in the REPL due to a Julia REPL limitation.