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,000
  • 4
  • 47
  • 84
shivam
  • 211
  • 1
  • 2
  • 14

1 Answers1

1

View is an array, you need to index it.

response_data = data['Response']['View'][0]['Result'][0]['Location']['Address']       
Barmar
  • 669,327
  • 51
  • 454
  • 560
  • 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