Skip to content

rizwanwebdev/auto-comment-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Auto Comment Bot

This script automatically fills out and submits comment forms on websites provided in a Google Sheet.


Features

  • Fetches website URLs from a Google Sheet.
  • Opens each website in Chrome.
  • Automatically detects and fills comment, name, email, and website fields.
  • Submits the form.
  • Updates the Google Sheet status for each website.

Installation Guide

Requirements

  • Python 3.x
  • Google Chrome Browser
  • ChromeDriver (matching your Chrome version)

Python Libraries

Install the required libraries by running:

pip install selenium gspread oauth2client

ChromeDriver Setup

  1. Download ChromeDriver from: https://sites.google.com/a/chromium.org/chromedriver/downloads
  2. Extract and place chromedriver.exe somewhere easily accessible.
  3. Add the ChromeDriver location to your System PATH or place it in the same folder as your script.

Credentials Setup

This script needs access to your Google Sheets via Google API credentials.

  1. Visit Google Cloud Console.
  2. Create a new project.
  3. Navigate to APIs & Services > Credentials.
  4. Click Create Credentials > Service Account.
  5. Save the generated JSON key file as credentials.json in the same directory as your script.
  6. Share your Google Sheet with the service account's email address (something like [email protected]) with Editor permission.

Configuration

  • Update your Google Sheet URL: Replace the "Your Google Sheet Link" in the script with the URL of your Google Sheet.
sheet = client.open_by_url("Your Google Sheet Link").sheet1
  • Update Chrome Profile Path: Replace the path in the script with your own Windows username and Chrome profile:
profile_path = "C:\\Users\\Your User Name\\AppData\\Local\\Google\\Chrome\\User Data"
options.add_argument(f"user-data-dir={profile_path}")
options.add_argument("--profile-directory=Profile 1")
  • Edit Your Personal Info: Update the name, email, website, and message fields in the script.
name = "Your Name"
email = "[email protected]"
website = "https://yourwebsite.com/"
message = "Your Comment Message Here"

How To Run

  1. Make sure Chrome is closed (the script auto-closes it anyway).
  2. Run the script:
python your_script_name.py

The script will:

  • Open each website in a new tab
  • Fill and submit the comment form
  • Close the tab and move to the next website
  • Update the Google Sheet with "Comment Added" or "Error"

Important Notes

  • This script is Windows-specific because it uses os.system("taskkill /f /im chrome.exe") to close Chrome.
  • Make sure your Google Sheet has a column with the word "website" in its header (e.g., "Website", "Website URL").
  • If your comment forms have different structures, you might need to adjust the XPaths and field detection logic.

Disclaimer

Use this script responsibly. Spamming websites without permission may violate terms of service and could lead to account bans or legal action.


License

This project is for educational purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages