Answer the question
In order to leave comments, you need to log in
How to get the id and repost of a post by a user in VK?
Hey!
Ideally, you need to pull out all over the public, but I will be glad if you tell me how to snatch data from at least one post =))
I get information from the record by
session = vk.AuthSession(app_id=MyVkData.APP_ID, user_login=MyVkData.LOGIN, user_password='hardPassword129rynh')
vkapi = vk.API(session)
comments = vkapi.wall.getComments(owner_id="-50035681",post_id="266057",count='25', v="5.95")
//и прикладываю пандас
import pandas as pd
import json
data = comments
json_str = json.dumps(data)
resp=json.loads(json_str)
print(resp)
df = pd.io.json.json_normalize(data['items'])
print(df)
//df.to_csv(r'comment.csv', index=False)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question