D
D
D55RUS2020-05-06 12:58:53
Python
D55RUS, 2020-05-06 12:58:53

How to parse json response?

5eb28a094443b227935801.png
From all this, I need to pull out each "id" and "classid". I understand what needs to be done through the for loop, but I don't know how. help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-05-06
@D55RUS

import json

j = json.loads(здесь ваша строка json)

for x in j['items']:
  print(x['id'] +' - '+ x['classid'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question