Skip to content

chakravarty-with-a-v/Instagram-Bot-with-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram-Bot-with-GUI

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

TO RUN THIS PROJECT :

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"

USER INPUTS:

(1) In FIRST WINDOW User needs to provide Target USER ID

Main Menu

(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

comment

(3) For Follow and Unfollow Buttons, The Bot automatically Follows and Unfollows The Target Account

Bot CLASS

SELENIUM AND CHROME DRIVER

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

Bot Methods

(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

GUI

Main Window

This is created in the main python file Instagram_Bot.py using tkinter

COMMENTS WINDOW

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

likecomment members

(1) Window Entries are class members namely comment entry and number entry
(2) An Object of TK class
(3) An Object of Bot class

likecomment methods

comment_input() -> to take input from Entries and store them in methods of likecomment.Bot accordingly.

MESSAGEBOX from tkinter

Used for Generating Error or Information Messages

Releases

No releases published

Packages

No packages published

Languages