K
K
Konstantin Volkov2014-11-05 15:50:33
Python
Konstantin Volkov, 2014-11-05 15:50:33

How to save JSON string?

I send a get request to https://api.vk.com/method/wall.get?owner_id=-34064... I get a response

{"response":[17826,{"id":38748,"from_id":-34064059,"to_id":-34064059,"date":1415138263,"post_type":"post","text":"","attachment":{"type":"photo","photo":{"pid":343974745,"aid":-7,"owner_id":-34064059,"user_id":100,"src":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d8\/2H24WUqDNf8.jpg","src_big":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d9\/YkfVFBCO0ug.jpg","src_small":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d7\/xMKTipZMDJA.jpg","width":604,"height":401,"text":"","created":1415138263,"post_id":38748,"access_key":"26180eb98231e05433"}},"attachments":[{"type":"photo","photo":{"pid":343974745,"aid":-7,"owner_id":-34064059,"user_id":100,"src":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d8\/2H24WUqDNf8.jpg","src_big":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d9\/YkfVFBCO0ug.jpg","src_small":"http:\/\/cs7003.vk.me\/c540104\/v540104662\/235d7\/xMKTipZMDJA.jpg","width":604,"height":401,"text":"","created":1415138263,"post_id":38748,"access_key":"26180eb98231e05433"}}],"comments":{"count":0},"likes":{"count":57},"reposts":{"count":2}}]}

how do i parse a json string for further processing

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentine, 2014-11-05
@kostya__wolf

I think you 've already been answered.
but in general, if you need to chew, then

import json
object = json.loads(str)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question