The Project uses Selenium and Chrome WebDriver to login to Instagram and do the following :
(1) Like and Comment on Target Account
(2) Follow Target Account
(3) Unfollow Target Account
The Project uses tkinter for GUI
Download the files and store them in the same folder.
Make sure to have Chrome Driver installed as per your Chrome VERSION : link-> https://chromedriver.chromium.org/downloads
chrome_driver_path should be : file path where you installed chromedriver + "\chromedriver.exe" for WINDOWS and simply "\chromedriver" for Mac
EXAMPLE : In My case , Chrome Driver was installed in "C:\Users\hp\Desktop\PROGRAMS\Chrome Driver"
so I appended "\chromedriver.exe" as I am Using WINDOWS to get "C:\Users\hp\Desktop\PROGRAMS\Chrome Driver\chromedriver.exe"
(1) In FIRST WINDOW User needs to provide Target USER ID
(2) If User selects Like and Comment Option a new Dialog Box Opens asking for Comment Text and Number of Posts to like starting from recent post
(3) For Follow and Unfollow Buttons, The Bot automatically Follows and Unfollows The Target Account
Bot Class Members :
(1) Using Selenium and Chrome Driver, a webdriver.Chrome Object is created. Using it I have made the driver to open to https://www.instagram.com/accounts/login/
(2) target : String to store User ID of Target Account
(3) comment : To Store User Comment
(4) number : To Store the number of new posts from latest post to like and comment
(1) login() -> Logs into Bot's Instagram Account
(2) search() -> Finds ID based on target ID input from USER. If ID is invalid , it generates an error message and returns to Home Page
(3) follow() -> Employs Search method and then follows user. If User is already followed , generates an error message. Finally returns to Home Page
(4) unfollow()-> Same as follow() method except that it unfollows target account
(5) private()-> Checks if target account is private with respect to the Bot account.
(6) like_comment() -> Searches Target Account , checks if it is Not Private with respect to Bot Account and then likes and comments Target Account Posts based on User Input
(7) home() -> Returns to Home Page
This is created in the main python file Instagram_Bot.py using tkinter
This is created using LikeComment class in likecomment.py
likecomment class objects take a Tk type object and a Bot type Object as parameters and the Window is Created using tkinter
(1) Window Entries are class members namely comment entry and number entry
(2) An Object of TK class
(3) An Object of Bot class
comment_input() -> to take input from Entries and store them in methods of likecomment.Bot accordingly.
Used for Generating Error or Information Messages