This script uses Selenium and the ChromeDriver to scrape the number of followers for a given Instagram account. It saves the number of followers to a text file called "followers.txt" in the same directory as the script.
Required to have Python 3 installed -> https://www.python.org
- Install Python on your system if it's not already installed.
- Rename .env.example to .env and add ig username in example file.
- Install the required packages using the command pip install -r requirements.txt.
- Open the command prompt or terminal and navigate to the directory where the script is saved.
- Run the script using the command
python run.py
. - The script will look for an environment variable called USERNAME and use its value as the account name.
- Wait for the script to complete execution. Once it's done, the total number of followers for the given Instagram account will be saved in a file called followers.txt in the same directory where the script is saved.
p.s. Optionally If you want to scrape followers of a specific Instagram account using an argument, you can pass the account name as a command-line argument. For example, python run.py account_name
.