Skip to content

A program that prints two lists: a list of people that you follow, but don't follow you back, and a list of people that follow you, but that you don't follow back on Instagram, using Selenium

License

Notifications You must be signed in to change notification settings

kyletimmermans/wicked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version 6.4 Python 3.12 Latest Commit kyletimmermans Twitter

Wicked

A program that prints two lists: a list of people that you follow, but don't follow you back, and a list of people that follow you, but that you don't follow back on Instagram, using Selenium

Sample Program Output

How it works

This program scrapes Instagram web pages and uses that data to make requests to Instagram's GraphQL API (no need for an API key!), in order to create lists of the usernames that follow you and that you follow. By comparing the two lists, it returns all the usernames that are in the "Following" list and are not in your "Followers" list. Essentially, showing you who has not followed you back. It does the same process for showing you who follows you, but you aren't following them back.

Wicked uses several evasion/masquerading techniques, including throttling, to appear as a legitimate user and to prevent being seen as a bot/web scraper.

How to run it

  1. Prerequisite: Must have Python3
  2. Run: pip3 install -r requirements.txt
  3. Run: python3 Wicked.py
  4. Input your username/email/phone # and password for Instagram (MFA code too, if enabled), and wait a few minutes for it to return the results. Run time is dependent on how many people you follow / follow you

Note:

  • This program does not log your username or password, it simply passes it to the Instagram login form
  • This program uses HTTPS and TLSv1.3 to send information to Instagram

Program Flags

-h, --help, -u, --usage         Show usage/help menu

-v, --version                   Print program version

-o, --output                    Write results (both lists) to file
                                E.g. python3 Wicked.py -o results.txt

Changelog

v1.0: Initial-Release
v2.0:
  -Handle for possible incorrect username and password and re-input them if their incorrect
  -Handle path change for different Operating Systems (Windows, OSX, Linux)
  -Automatically add and then remove a line from 'hosts' file to fix selenium error
v2.1: Added progress bars while loading results
v2.2:
  -Added error handling for not being able to find the host file
  -Added error handling for not finding chromedriver in the same folder as itself
  -Added "Establishing Connection" print line
  -Removed logs showing up in console for Windows
v2.3:
  -Added error handling for no internet connection
  -Added better error handling for chromedriver not found in 'Wicked.py' directory
  -Better error handling for hosts file not found
  -Syntax sugar added, small code cleanup
v2.4:
  -Fixed JavascriptException: Cannot read property 'scrollTo' of null
  -Fixed issue where selenium couldn't find user profile div
  -Fixed issue with output where '1' would randomly show up
v2.5:
  -Added final count of usernames along with Results
  -Fixed issue with accounts that have a 'K' or 'M' in their following/followers number
  -Login page needed to have 'react-root' replaced with 'loginForm'
  -Automatically remove "Headless" from user agent string for the driver (Instagram can block headless ones)
  -Fixed bs4 list iterator
  -Logic for (following - followers) detailed in comments
v3.0:
  -Using TLSv1.2 to send information
  -Added MFA Support
  -Added better correct-login checking
  -Added v3 to the ASCII art title
  -Removed JavaScript that scrolls div (was always changing) and sends scroll key instead
v3.1:
  -Added Python Shebang
  -Added if __name__ == "__main__":
  -Refactor / Moved code into main
  -Removed hard-coded XPATHs
  -Added language chromedriver flag to force en-US
  -Added --version and -v command line flag
v4.0:
  -Added option to take email or phone number instead of just Instagram username
  -Added support for million(s) and just 0 followers / following
  -Using wakepy to prevent program from sleeping and crashing
  -Deal with "Suggested for you" accounts in following modal
  -Bug & Logic fixes
  -Selenium:
    -Switched from executable_path to "service" model
    -Switched to new "find_element(By.)" model
    -No longer clicking follower / following modal, now visits links: instagram.com/{username}/followers
    -Removed hard-coded cursor coordinates system for scrolling modal
    -Using WebDriverWait to wait for elements to show up
v4.1: Print results to a .txt file
v4.5: Now using webdriver-manager to automatically install chromedriver
v4.6:
  -Removed host file manipulation files
  -Regex fixes
v4.7:
  -Switched from getpass to pwinput for password masking
  -Fix failed MFA retry support
  -Scrolling method now requires window resize event to open each time to load followers/following
  -Using TLSv1.3 to send information
v5.0:
  -Added feature to see who you don't follow back
    -Updated banner with new program description
  -Added: -h, -u, --help, --usage flags
  -Fixes to ensure that all following/followers are retrieved properly
    -Removed scrolling method - Switched to intercept & replay XHR
v6.0:
  -Now using GraphQL API endpoints to get follower and following username lists
    -Getting follower and following count done through this API as well
v6.1:
  -Fixed issue where webdriver-manager would cause a crash
    -Catch error and let user know that Chrome needs to be updated
  -Fixed method for grabbing user_id
  -Deprecated unused 'dpr' key in 'headers' key-value store
  -Switched to f-strings from string concatenation for error messages and ASCII art
  -Removed "DevTools listening on ws://" and TensorFlow debug logs showing up in Windows stdout
  -Updated dependencies (requirements.txt)
v6.4:
  -Fixed: Now using CREATE_NO_WINDOW (subprocess) to prevent unnecessary logging on Windows (DevTools listening, TensorFlow), the flags added in the last version did not work
  -Removed: No longer using webdriver_manager library, Selenium's webdriver.chrome.service handles getting the chromedriver
  -Added: -o / --output flag - Results file no longer created by default, need to provide this flag and a filename to get a results file now
  -Added: Extra chromedriver flags to further prevent automation detection
  -Changed: All flags/args being parsed with argparse now

About

A program that prints two lists: a list of people that you follow, but don't follow you back, and a list of people that follow you, but that you don't follow back on Instagram, using Selenium

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages