top of page

How to comment and send DMs on Instagram using Python Script

-Introduction: In this blog post, we will explore how to automate commenting and sending direct messages on Instagram using a Python script. We will leverage the power of the Selenium library to interact with the Instagram website and perform these actions programmatically. By following the steps outlined below, you'll be able to set up and use the script to enhance your Instagram engagement effortlessly.

-Prerequisites: Before we begin, ensure that you have the following:

  1. Python installed on your system (version 3.6 or above).

  2. Basic knowledge of Python programming.

  3. Familiarity with the command line or terminal.

Step 1: Setting up the Environment: To get started, follow these steps:

  1. Clone or download the script from the GitHub repository.

  2. Open your terminal or command prompt and navigate to the project directory.

  3. Install the required dependencies by running the following command:

pip install -r requirements.txt

Step 2: Using the Script: The script provides various options to interact with Instagram. Let's explore them:

  • Commenting on Posts:

  • Run the script with the -c or --comment option.

  • Specify the hashtag you want to scrape posts from using the -ht or --hashtag option.

  • Set your desired comment message using the -cm or --message option.

  • Optionally, adjust the delay between comments with the -del or --delay option.

  • Example command: "python -c -ht python -cm "Great post!" -del 5"

  • Sending Direct Messages (DMs):

  • Run the script with the -d or --dm option.

  • Enter the usernames you want to send DMs to when prompted, separated by commas.

  • Set your desired message using the -cm or --message option.

  • Optionally, adjust the delay between DMs with the -del or --delay option.

  • Example command: "python -d -cm "Hello, I love your content!" -del 10"

  • Multiple Accounts Mode:

  • Run the script with the -a or --accounts option to enable multiple accounts mode.

  • Follow the prompts to add Instagram usernames and passwords for each account.

  • The script will store the account information securely for future use.

-Conclusion: With the provided Python script, automating your Instagram engagement has never been easier. You can now comment on posts and send DMs effortlessly, saving you time and effort. By customizing the script according to your preferences, you can enhance your Instagram presence and interact with your followers effectively.

For more details, visit the GitHub repository and refer to the documentation and source code. Additionally, you can watch the accompanying YouTube Video for a step-by-step guide on setting up and using the script.

Give it a try and enjoy a streamlined Instagram experience with the power of automation!

106 views0 comments
bottom of page