json format file parsing question

Asked 2 years ago, Updated 2 years ago, 59 views

I'd like to extract some value values from the json file below

I squeezed out the source that approaches the value value as shown below.

There is a key value error as shown below. What is wrong?

python crawling json api

2022-09-21 20:51

2 Answers

If you look at the JSON you posted (it should be text, but somehow it's a screenshot image)...

SIGUN_NM = data["ReliefAction"]["row"][num1]["SIGUN_NM"]

Shouldn't you do this?


2022-09-21 20:51

If you add ["row"], there is a bug that str cannot be used


2022-09-21 20:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.