Making publishing posts on Facebook easier and faster by using a bot posting to many pages very fast, getting a list of group members out of Facebook group and even scheduling posts to different dates and hours. The bot was built using pure python with selenium as the client, SQLite3 for database and PyQt5 for GUI.
selenium~=3.141.0
pyqt5~=5.14.2
pysqlite3
keyring~=10.6.0
cryptography>=3.2
pip install selenium pyqt5 pysqlite3 cryptography keyring
or
pip install -r requirements.txt
You also need to have mozilla geckodriver you can get it here .
If you wish to use some other browser binary supported by selenium (i.e. Chrome), you need to edit 'Bot.py'.
replace :
self.driver = webdriver.Firefox(options=self.options)
with something like :
self.driver = webdriver.Chrome(options=self.options)
Make sure you have geckodriver binary (or any other browser) in project directory or you might want to specify the path in Bot.py.
E.g. self.driver = webdriver.Firefox(executable_path="/data/Drivers/geckodriver",options=self.options)
When you've got all of it ready, you can start the gui by execute python main.py in command line.
You need first to create a user by clicking the add user button, a dialog window will open, enter username and password and click ok.
Once you've got your user created you can continue and add posts,targets and scheduled tasks all of those will be stored in the database for the user who created them and will remain there until you delete them.
Login:
Select the user from the existing users dropdown, and click the login button.
You can choose to run the browser driver headless or not by checking the hide browser checkbox.
Post:
First you need to create post by clicking the add post button, insert the post content and select the media file using the dialog browse button. both field are optional but at least one of them must be non empty in order to create new post.
Add target by clicking the add target button and entering facebook url you wish to post to.
Now go ahead and select one post from the posts list, you can select one or more targets from the targets list by using Ctrl or Shift and click the post button.
Scrape:
Add a group target i.e facebook.com/group/123456, using the add target button.
Select the group target you've added and click the scrape button.
List with group users and their facebook profile link will show in the log text.
Tasks:
Tasks are comprised of post, one or more targets,date and task name.
Each task is associated with the user created that task, means that the task will execute as that user, you can schedule multiple tasks for multiple users at the same time.
The tasks executor runs on separate thread so you can select the tasks you want to schedule to run and continue to use the script.
You can run tasks by selecting one or more tasks from the tasks list and click the run task button.
Load File:
You can load a json like file containing your posts and targets.
the structure for the json file should be as follow:
{
"posts":[# Facebook-Posts-Automation
Making publishing posts on Facebook easier and faster by using a bot that can post to multiple pages efficiently, extract group member lists, and schedule posts across different dates and times. The system is built using Python with Selenium for browser automation, SQLite3 for database management, and PyQt5 for GUI.
---
## π§© Dependencies
* selenium~=3.141.0
* pyqt5~=5.14.2
* pysqlite3
* keyring~=10.6.0
* cryptography>=3.2
---
## βοΈ Installation
Install dependencies:
```bash
pip install selenium pyqt5 pysqlite3 cryptography keyring
or
pip install -r requirements.txtYou also need a browser driver such as geckodriver (for Firefox).
Download: https://github.com/mozilla/geckodriver
If you want to use Chrome or another browser, update Bot.py:
Replace:
self.driver = webdriver.Firefox(options=self.options)With:
self.driver = webdriver.Chrome(options=self.options)Also ensure the driver path is set correctly:
self.driver = webdriver.Firefox(executable_path="/data/Drivers/geckodriver", options=self.options)Start the application:
python main.py- Click Add User
- Enter username & password
- Each user has separate posts, targets, and tasks stored in the database
- Select user from dropdown
- Click login
- Option to run browser in headless mode (hide browser)
- Click Add Post
- Add message and/or media
- At least one must be provided
- Click Add Target
- Enter Facebook page/group URL
- Select post
- Select one or more targets (Ctrl/Shift)
- Click Post
- Add group URL as target
- Select it
- Click Scrape
Output:
- Group members list
- Profile links in logs
Tasks include:
- Post
- Targets
- Date & time
- Task name
Features:
- Multi-user task execution
- Runs in background thread
- Can execute multiple tasks simultaneously
Steps:
- Create task
- Select tasks
- Click Run Task
You can bulk import posts and targets using a JSON file:
{
"posts":[
{"msg":"sometext1" ,"media":""},
{"msg":"sometext2", "media":"C:\\some_media_path"}
],
"targets":[
{"target": "https://www.facebook.com/groups/189076xxxx"},
{"target": "https://www.facebook.com/groups/189076xxxx"}
]
}- Multi-account automation
- Bulk posting
- Scheduled tasks
- Group member scraping
- GUI-based control panel
- Headless browser option
- Platform UI changes may affect automation
- Use responsibly to avoid account restrictions
- Add delays and human-like behavior for safer execution
This project is a complete automation system that combines:
- Python backend
- Browser automation (Selenium)
- GUI (PyQt5)
- Database (SQLite3)
to create a powerful social media posting and scraping tool.
{"msg":"sometext1" ,"media":""},
{"msg":"sometext2", "media":"C:\\some_media_path"}
],
"targets":[
{"target": "https://www.facebook.com/groups/189076xxxx"},
{"target": "https://www.facebook.com/groups/189076xxxx"}
]
Muhammad Yasir AI & Automation Engineer GitHub: github.com/devxyasir LinkedIn: linkedin.com/in/devxyasir




