title: Access JSON Key in Python
body: <p>I'm trying to print out all the <code>cpe_mac</code> fields of my JSON data.</p>
  <h1>I have</h1>
  <pre><code># Last updated : BH | 8/31/2016
  
  import requests
  import json
  
  ssc_ip = raw_input(&quot;What is your SSC Host (Ex. http://172.19.242.32:1234/ ) ? : &quot;)
  if not ssc_ip:
      ssc_ip = 'http://172.19.242.32:1234/'
  
  cpe_num = raw_input(&quot;How many CPE(s) you want to delete ? : &quot;)
  print '\n'
  
  url = ssc_ip+'vse/vcpes'
  json_data = requests.get(url).json()
  # print json_data
  
  for x in json_data:
      print json_data.cpe_mac
  </code></pre>
  <hr />
  <p>I kept getting</p>
  <p><code>AttributeError: 'dict' object has no attribute 'cpe_mac'</code></p>
  <hr />
  <h1>Trying</h1>
  <p><code>print json_data['cpe_mac']</code></p>
  <p>I got</p>
  <p><code>KeyError: 'cpe_mac'</code></p>