Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
To get information about users, I recommend using the API
. First of all, install vk api (for simplicity, you can also generate requests manually)
pip install vk
Well, then using this construction, you get the current status:
import vk
import datetime
session1 = vk.AuthSession(access_token='твой токкен')
vk_api = vk.API(session1, v=5.62)
def get_user_status():
value = vk_api.users.get(user_ids='4010754', fields='last_seen')
print(value) # <- получаешь данные вида [{'id': айди, 'first_name': 'Имя', 'last_name': 'Фамилия', 'last_seen': {'time': 1560796737, 'platform': 7}}]
time = datetime.datetime.fromtimestamp(value[0]['last_seen']['time'])
print(time)
get_user_status()
>>> datetime.datetime.fromtimestamp(1004260000)
datetime.datetime(2001, 10, 28, 1, 6, 40)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question