title: Extracting data from dictionary returned by json.loads
body: <p>Here is what I am trying to do:  Prompt for an URL, read the JSON data from that URL using urllib and then parse and extract the comment counts from the JSON data and compute their sum.</p>
  
  <p>Here is what I have so far in Python:</p>
  
  <pre><code>import json
  import urllib
  
  serviceurl = 'http://python-data.dr-chuck.net/comments_42.json'
  
  while True:
      url = serviceurl + urllib.urlencode(('sensor':'false', 'address' : address))
      print "Retrieving", url
      uh = urllib.urlopen(url)
      data = uh.read()
      print "Retrieved", len(data), "characters"
  
      try:    js = json.loads(str(data))
      except:     js = None
  
      print js.dumps(js, indent = 4)
  
      js = ["comment"][0]["count"]
      lst = list()
      lst.append(js)
      print sum(lst)
  </code></pre>
  
  <p>Here is what the JSON data looks like:</p>
  
  <pre><code>{
    comments: [
      {
        name: "Matthias"
        count: 97
      },
      {
        name: "Geomer"
        count: 97
      }
      ...
    ]
  }
  </code></pre>
  
  <p>I am using Python 2. This is my first time doing this, so any feedback you can give me about this would be helpful, especially after the try/except statements. Thanks in advance.</p>