V
V
Vladimir2020-05-04 22:12:04
Python
Vladimir, 2020-05-04 22:12:04

Spared members of the VK community. How to iterate over the received response?

All the best!
Quite a novice in these matters ..
The bottom line. Naparsil through Vk_api a list of community members. Received a response in the form of a list (or an array, did not understand yet)):
{'response': [{'id': 111111111, 'first_name': 'name', 'last_name': 'lastname', 'city': {' id': 280, 'title': 'Kharkiv'}}]}
{'response': [{'id': 111111111, 'first_name': 'name', 'last_name': 'lastname', 'city': { 'id': 280, 'title': 'Kharkiv'}}]}

What cycle or method to go through this list to get a list of participants at the output, but on a specific request. For example, a list of users from the mountains. Moscow.
And how can I put it all in excel format in the future?

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Amigun, 2020-05-05
@Amigun

You received the answer in the form of a dictionary, you can work with it like a regular dictionary (read more about this on the Internet).
Why are you aiming at the parser right away, if you don’t even know the basics?
In Excel, you can display everything using a special library designed for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question