A Python script that uses the vk_api module to parse the texts of posts from a VKontakte page or group into .txt.
- You will need Python 3.11 to run the scirpt, which you can download, for example here.
- Run the following command:
pip install vk_api- Setup
config.json. - Run
main.py:
python3 main.py- The result
output.txtwill appear in the same directory asmain.py.
The config.json configuration file is used to set the behavior of the program to suit the user's needs. It contains:
access_token: your access token to VK API methods;domain: id of the VKontakte page or group;post_number: number of posts to retrieve. If set to0all page's or group's post will be retrieved;post_filter: post filter, which includes:ad_allowed: boolean of whether the post can be promotional;repost_allowed: boolean of whether the post can be a repost;restricted_words: a list of banned words;
This repository is open for contributing. So feel free to open issues and make pull requests.