First of all, you should be using json.loads
, not json.dumps
. loads
converts JSON source text to a Python value, while dumps
goes the other way.
After you fix that, based on the JSON snippet at the top of your question, readable_json
will be a list, and so readable_json['firstName']
is meaningless. The correct way to get the 'firstName'
field of every element of a list is to eliminate the playerstuff = readable_json['firstName']
line and change for i in playerstuff:
to for i in readable_json:
.