I have this code
import json
from pprint import pprint
json_data=open('bookmarks.json')
jdata = json.load(json_data)
pprint (jdata)
json_data.close()
How can I search through it for u'uri': u'http:?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As
json.loadssimply returns a dict, you can use the operators that apply to dicts:Edit: to give an idea regarding how to loop through the data, consider the following example:
Inspecting the
jdatadata structure will allow you to navigate it as you wish. Thepprintcall you already have is a good starting point for this.Edit2: Another attempt. This gets the file you mentioned in a list of dictionaries. With this, I think you should be able to adapt it to your needs.
To then “search through it for
u'uri': u'http:'“, do something like this: