// JSON
{
"items": [
{
"title": "welcoem home",
"author": "Charles Dickens"
},
{
"title": "Harry Potter",
"author": "J rowling"
}]
}
这是我的json脚本..我需要从中找到“items”,title和author字段及其值。我正在使用参考system.net.json。
答案 0 :(得分:0)
在python中?
data = """
{ "items": [ { "title": "welcoem home", "author": "Charles Dickens" }, { "title": "Harry Potter", "author": "J rowling" }] }
"""
import json
data2 = json.loads(data)
authors = [x['author'] for x in data2['items']]