Facebook Posting Bot

Khushal Sharma
2 min readSep 18, 2017

--

I am very lazy person so i tried to automate the process of go to facebook , log in and write post and then click on submit.for that I made an python bot that login to facebook and post your status and close the browser instance ( selenium makes browser instance for every browser.get request and by closing everything get deleted) or can say log you out.

One fine day i was posting an thread (post) on facebook and this thought came to my mind, on the same day i read about selenium automation module in python.selenium is a automation module used to automate browsing.

Link : — Browser Automation

then i read about it on it’s documentation and came to know this can work so i started write an script.

You can install it via

pip install selenium

when it runs it asks you to enter your email id,

and then your password, but password isn’t visible, Thanks to these two lines…

import getpass
password=getpass.getpass("Enter your Facebook password: ")

and then it moves to your account and type your message there,

and then it submit the post.

You can see live experiment here.

The code is open sourced and can be found here — Logan1x/Python-Scripts

Thanks for reading this ;)

If you felt this post helped you, give it a ❤. Follow me on twitter for more.

You can see more post like these on my blog.

--

--