S
S
SharKKProd2020-08-23 10:02:13
Python
SharKKProd, 2020-08-23 10:02:13

How to get only the data you need in python (VK Api)?

I need to get only the ID of the person who added me as a friend
Code:

import vk_api
login = input('Введите логин: ')
password = input('Введите пароль: ')
vk_session = vk_api.VkApi(login, password)
vk_session.auth()
vk = vk_session.get_api()
zarposi = vk.friends.getRequests(
)
print(zarposi)

I get:
{'count': 3, 'items': [286500468, 580014582, 413063253]}

How can I extract all IDs?
Update - Only ID, nothing more

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lesha, 2020-08-23
@hydrugz

import json
print(zarposi['items'])
Thanks for the answer SoreMix

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question