0
我正在处理请求,并且我被困住了,因为我正在更改我的源代码。事情是,当我请求对象的网站,它返回以下JSON对象:如何解析这个json对象到Python?
[
{
"directory":"ca\/48",
"hash":"ca4860af9e3be43b1d23b823af607be4",
"height":1839,
"id":3461818,
"image":"ca4860af9e3be43b1d23b823af607be4.jpg",
"change":1480968006,
"owner":"danbooru",
"parent_id":null,
"rating":"s",
"sample":true,
"sample_height":1398,
"sample_width":850,
"score":0,
"tags":"1girl breasts cape cleavage defense_of_the_ancients dota_2 green_eyes highres lyralei medium_breasts parted_lips pauldrons red_hair smile solo splashbrush thick_thighs thighs toes",
"width":1118,
"file_url":"http:\/\/gelbooru.com\/images\/ca\/48\/ca4860af9e3be43b1d23b823af607be4.jpg"
}
]
我想从"http:\/\/gelbooru.com\/images\/ca\/48\/ca4860af9e3be43b1d23b823af607be4.jpg"
的"file_url"
值更改为
所以我通过在我的程序构建器上调用它可以完全使用该网站。 我该怎么做? 在此先感谢。
可能有数百个类似的问题。请在发布可能是重复的内容之前进行一些调查。 –
“json对象”在Python中不太重要。你有一个单一的项目,这是一个字典。如果你知道如何修改一个字典并访问一个列表元素,你会发现其余的。 – bereal
'requests'可以将JSON转换为python dictionary/list - 'response.json' - 它可以将'\ /'转换为正确的文本。 – furas