17.03.2020, 19:31
(This post was last modified: 17.03.2020, 20:00 by benanderson_475.)
(17.03.2020, 10:10)tomnord Wrote: Thanks, so I've gotten a bit further, but not quite there.try this,
I am now reading the decoded json from string, but now I'm stuck at setting up import from this URL:
https://www.vg.no/spesial/2020/corona-vi...-overview/
got it:
require('ssl.https')
require('json')
data = ssl.https.request("https://www.vg.no/spesial/2020/corona-viruset/data/norway-table-overview/")
dec = json.decode(data)
confirmed= dec["cases"][4]["confirmed"]
log(confirmed)
Code:
log(dec.totals.confirmed)
--instead of confirmed= dec["cases"][4]["confirmed"] use,
confirmed = dec.totals.confirmed
log(confirmed)
or log(dec.cases[4].confirmed)