Answer the question
In order to leave comments, you need to log in
How to parse the name and VK user ID from a link to his profile?
I have a telegram bot in which it is necessary that when you insert a link to a user in VK, you receive his name and user ID. There is no information on this issue on the Internet, only ways to parse VK groups, but I don’t need it. I would be glad if someone showed or explained how to parse such data.
Answer the question
In order to leave comments, you need to log in
If the link is https://vk.com/id663629411 or https://vk.com/innkvi
link_string = "https://vk.com/id663629411"
user = link_string.split("/")[-1].replace("id", "")
id
, so add an extra check. user
from the code above to the user_ids
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question