Answer the question
In order to leave comments, you need to log in
How to get data using wall.get?
I can not get data from the group wall, I wrote this code:
import vk_api
import datetime
import time
while True: # Не понятно работает или нет. Ошибок не наблюдается.
vk = vk_api.VkApi(token="токен")
group_id = '-id' # Сообщество из которого нужно "парсить" так сказать.
vk.method("wall.get", {"owner_id": group_id, "count":1})
time.sleep(1000)
while True: #Данный кусок работает, ошибок нет.
vk = vk_api.VkApi(token="токен")
group_id = '-id'
text = "Тут типо текст для записи"
vk.method("wall.post", {"owner_id": group_id, "from_group":1, "message": text})
time.sleep(6000)
Answer the question
In order to leave comments, you need to log in
Well duck probably need to assign the text to a variable and get to it?
import vk_api
import datetime
import time
vk = vk_api.VkApi(token="токен")
api = vk.get_api()
group_id = -0
my_id = 0
while True:
text = api.wall.get(owner_id=group_id, count=1)['items'][0]['text']
api.wall.post(owner_id=my_id, from_group=1, message=text)
time.sleep(1000)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question