Q:

Navigation through json (phyton)

I'm trying to navigation through a json file but cannot parse properly the 'headliner' node.
Here is my JSON file : 
{  
   "resultsPage":{  
      "results":{  
         "calendarEntry":[  
            {
              "event":{  
                 "id":38862824,
                 "artistName":"Raphael",
               },
               "performance":[  
                  {  
                     "id":73632729,
                     "headlinerName":"Top-Secret",
                  }
               }
            ],
            "venue":{  
               "id":4285819,
               "displayName":"Sacré"
            }
         }
      }
   }

Here is what I my trying to do : 
for item in data ["resultsPage"]["results"]["calendarEntry"]:
    artistname = item["event"]["artistName"]
    headliner = item["performance"]["headlinerName"]

I don't understand why it's working for the 'artistName' but it's not working for 'headlinerName'. Thanks for your help and your explanation.

A:

Notice your performance key:
"performance":[  
                  {  
                     "id":73632729,
                     "headlinerName":"Top-Secret",
                  }
               }
            ],

The json you posted is malformed. Assuming the structure is like:
"performance":[  
                      {  
                         "id":73632729,
                         "headlinerName":"Top-Secret",
                      }

              ],

You can do:
for i in item:
    i["headlinerName"]

or as @UltraInstinct suggested:

item["performance"][0]["headlinerName"]

