- Introduction
- Getting Started
- Usage
- Important Notes
- Directory Structure
- Example Data
- Contributions and Feedback
- License
The Instagram Follower and Following Scraper is a Python program that automates the process of scraping follower and following data from Instagram profiles. It uses Selenium for web automation to collect valuable information such as profile names, profile links, profile image links, blue tick presence, and follow-back status.
Before you begin, make sure you have the following prerequisites:
- Python 3.x
- Microsoft Edge browser installed
- Selenium Python package
Follow these steps to set up the project:
-
Clone or download this repository to your local machine.
-
Open a terminal or command prompt and navigate to the project directory.
-
Install the required packages by running:
pip install -r requirements.txt
Before running the program, configure the config.json
file in the ./Modules/
directory. Provide your Instagram username and password (ensure that two-factor authentication is disabled) in the following format:
{
"username": "username",
"password": "password"
}
To run the Instagram Follower and Following Scraper, execute the following command:
python main.py
The program will log in to your Instagram account, scrape the followers and following data, and store it in CSV files.
To scrape a specific user's followers and following, you can mention the usernames in a list format in the python main.py by giving argument users = ["f1", "f2"]
. The program will attempt to scrape data for users whose profiles are public or who you are following.
The CSV files generated by the program have the following format:
Profile Name
: The name of the Instagram user.Profile Link
: The link to the user's Instagram profile.Profile Image Link
: The link to the user's profile image (if available). If it is "False," it means the user has an active story, and the image link cannot be retrieved.Blue Tick
: EitherTrue
orFalse
, based on the presence of a blue verification tick on the account.Follow Back
:True
if you are following the user; otherwise,False
.
- You can run the program multiple times. The program performs a normal login at the start and then saves cookies. For subsequent login attempts, the same cookies are reused, reducing the need for repeated logins.
./Data/followers
: Directory containing followers' CSV files../Data/following
: Directory containing following CSV files../Modules/
: Directory containingconfig.json
andcookies.json
files.
An example data, "f1" Instagram profile of followers and following has been scraped. You can find the CSV files here:
- Followers:
./Data/Followers/f1_followers.csv
- Following:
./Data/Following/f1_following.csv
Contributions, suggestions for improvements, and bug reports are always welcomed. Please feel free to open issues or submit pull requests on the project's GitHub repository.
This project is licensed under the MIT License. You are free to use, modify, and distribute the code as per the terms of the license.
Disclaimer: This project is for educational and informational purposes only. Use it responsibly and in compliance with Instagram's terms of service and policies. The owner of the repository is not responsible for any misuse or violations.