So basically I am web scraping a site and for that I need "id"
of all the location from a complicated json content:
I have tried dict.items
method but i am getting only 2 values that are in start of the dict and then a list start:
res = requests.get(url).json()
json_obj = res.items()
for key, value in json_obj:
if key == "id":
print(value)
json = {
"count": 17652,
"items": [
{
"lat": 51.17450581504055,
"lng": 10.007757153036533,
"count": 17652,
"north": 54.1425475,
"east": 15.0019,
"south": 48.0039543,
"west": 5.952813,
"elements": [
{
"id": "5836de61a581c245ae48806b",
"o": 'null'
},
{
"id": "5836de62a581c245ae48814b",
"o": 'null'
},
{
"id": "5836de57a581c245ae487944",
"o": 'null'
},
{
"id": "5836de64a581c245ae4882a8",
"o": 'null'
},
{
"id": "5836de54a581c245ae48772a",
"o": 'null'
},
{
"id": "5836de57a581c245ae487945",
"o": 'null'
}
]
}
]
}