T
T
Ternick2018-10-14 23:38:32
Python
Ternick, 2018-10-14 23:38:32

How to find out if a person is online or not in VK?

Hello !
I want to make an alarm clock for VK :)
Everyone had such a situation that you need to ask a person a question :) But so that the person himself was online :)
And the first option is just to sit about your own business and check the person’s VK page :)
It seemed it would be much easier :)
But there are situations like this :)
N61RBsByQUWFoG7wxXJgEA.png
And bad thoughts immediately come into my head :)
That's why I want to make such an alarm clock :)
Now the very essence of the question:
How to find out if a person is online or not?
1) I thought that there is api somewhere in VK, but either I looked inattentively, or it's just not provided there!
2) Write a grabber (I did this):
2.1) So far, nothing really works out because I haven’t really dealt with, for example, the same BeautufulSoup and so far I’m stuck on it!
All that I did in these 6 minutes:
image4454335f000c9b8a.png
And I hung on the parse function, because in theory it should find this for me:
image819496df186dbf38.png
But it throws errors :)
And I thought maybe there is an easier way to get this cherished line somehow?
Error log from the parse function:
image8c36e7862d689daf.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-10-14
@dimonchik2013

the API is not provided for,
but the python, most likely, Websocket,
but you can also use the soup
you need to learn how to log in and then look for profile_time_lv and adjacent divs responsible for online
solve in three parts:
3) search for divs on a saved page
2) login
1) combine 2 + receiving + 3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question