Skip to content

Python program to scrape all Instagram followers and following data such as name, profile link and image using through your main account

License

Notifications You must be signed in to change notification settings

NyanCyanide/InstagramScrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram Follower and Following Scraper

Table of Contents

  1. Introduction
  2. Getting Started
  3. Usage
  4. Important Notes
  5. Directory Structure
  6. Example Data
  7. Contributions and Feedback
  8. License

1. Introduction

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.

2. Getting Started

Prerequisites

Before you begin, make sure you have the following prerequisites:

  • Python 3.x
  • Microsoft Edge browser installed
  • Selenium Python package

Installation

Follow these steps to set up the project:

  1. Clone or download this repository to your local machine.

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

  3. Install the required packages by running:

    pip install -r requirements.txt

3. Usage

Configuring the config.json File

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"
}

Running the Program

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.

Scraping Specific User's Followers and Following

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.

CSV File Format

The CSV files generated by the program have the following format:

followers.csv and following.csv

  1. Profile Name: The name of the Instagram user.
  2. Profile Link: The link to the user's Instagram profile.
  3. 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.
  4. Blue Tick: Either True or False, based on the presence of a blue verification tick on the account.
  5. Follow Back: True if you are following the user; otherwise, False.

4. Important Notes

  • 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.

5. Directory Structure

  • ./Data/followers: Directory containing followers' CSV files.
  • ./Data/following: Directory containing following CSV files.
  • ./Modules/: Directory containing config.json and cookies.json files.

6. Example Data

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

7. Contributions and Feedback

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.

8. License

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.

About

Python program to scrape all Instagram followers and following data such as name, profile link and image using through your main account

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages