如何在JSON中查找字段
这是我的json脚本。。我需要找到“项目”和标题和作者字段及其值。我在python中使用参考系统.net.json。如何在JSON中查找字段,json,Json,这是我的json脚本。。我需要找到“项目”和标题和作者字段及其值。我在python中使用参考系统.net.json。 // JSON { "items": [ { "title": "welcoem home", "author": "Charles Dickens" }, { "title": "Harry Potter", "author": "J rowling" }] } 发帖前你修改了你的问题吗?你确定你能理解自己的问题吗?请编辑您的问
// JSON
{
"items": [
{
"title": "welcoem home",
"author": "Charles Dickens"
},
{
"title": "Harry Potter",
"author": "J rowling"
}]
}
发帖前你修改了你的问题吗?你确定你能理解自己的问题吗?请编辑您的问题并解释您需要什么。。。别忘了告诉我们你用的是什么语言。看起来你好像看到了一些json波(问题之间的差异不到1小时)我还找不到任何解决方案。我需要dotnet的代码。我需要先找到“物品”。如果(“项”),则仅在其中查找文件和值。
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']]