This script scrapes handle
and name
from top posts on Instagram based on #hashtags using selenium webdriver
- Logs in
- Find instagram top posts by provided #hashtag
- Navigate to each
@handle
and saves@handle
,name
in a file
- Python 3.x+
pip
pip install -r requirements.txt
- Download chromedriver. Place in root directory.
- Create
influencers
andtags
file (no extension) in root directory - Set
IG_USERNAME
andIG_PASSWORD
environment variables $ python app.py
tags
file should look like:
gaming
mensfashion
Results will be stored in influencers
file. E.g.
pewdiepie,PewDiePie
markiplier,Markiplier
MAX_HANDLE_ATTEMPTS
set to25
by default. Sets the number of posts the script will scrape in a single run.MINIMUM_FOLLOWER_COUNT
set to10000
by default. Sets the minimum number of followers for influencer to be recorded.
- Duplicate
@handle
s will not be saved toinfluencers
file
- Emojis/special characters in names are ignored when saving to
influencers
- Commas in names are replaced as a space