0

The json is at:

https://pastebin.com/ZDQESKcX

This is my JSON response, i want to fetch the label value in address field using python(response>>view>>result>>location>>address>label), i need to print this label field value on the consol, please help, i have used this method :

I Tried:

response_data=data['Response']['View']['Result'][0]['Location']['Address']
Rahul
  • 10,830
  • 4
  • 53
  • 88
shivam
  • 249
  • 1
  • 5
  • 18

1 Answers1

1

View is an array, you need to index it.

response_data = data['Response']['View'][0]['Result'][0]['Location']['Address']       
Barmar
  • 741,623
  • 53
  • 500
  • 612
  • if i want to print some value from Result section, should this directory works?? – shivam Mar 06 '18 at 11:15
  • See https://stackoverflow.com/questions/48193502/access-a-particular-field-in-arbitrarily-nested-json-data for the general principles of accessing nested JSON data. – Barmar Mar 06 '18 at 20:39