Scrape Instagram User Posts, Followers and Following Numbers Using iMacros

In a previous video I gave you a script to scrape a list of users from Instagram into a CSV file. This script will extract the number of posts, followers and following for each user on that list. This script is vital for influencer research. With a complete list of users and their stats you’ll be able to filter influencers on Excel and target influencers you want to work with.

SCRIPT:

SET !DATASOURCE followers.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}

TAB T=1
URL GOTO=https://www.instagram.com/{{!COL1}}
TAG POS=1 TYPE=SPAN ATTR=CLASS:_fd86t EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}

TAG POS=2 TYPE=SPAN ATTR=CLASS:_fd86t EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}

TAG POS=3 TYPE=SPAN ATTR=CLASS:_fd86t EXTRACT=TXT
SET !VAR3 {{!EXTRACT}}

SAVEAS TYPE=EXTRACT FOLDER=* FILE=followers.csv

SET !EXTRACT NULL

WAIT SECONDS=1

Let me know if you have any issues with a comment below or through email.

Leave a Reply

Your email address will not be published. Required fields are marked *