Extract Instagram Captions with iMacros Bot Scraper

This Instagram scraper will extract the user name, caption and date from posts. Results are saved in a CSV file that can easily be filtered in Excel. Captions are extracted in HTML format. I had some trouble trying to extract them just the text. You should be able to remove HTML using find and replace on Excel or by using an HTML editor. The file will be located in the folder C:\Users\USERNAME\Documents\iMacros\Downloads. Username will be your unique PC username. If you have any questions drop a comment below or shoot me an email. Sign up for my newsletter for more Instagram scripts.

SCRIPT:

SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP YES
SET !TIMEOUT_STEP 1

TAB T=1
WAIT SECONDS=2
TAG POS={{!LOOP}} TYPE=A ATTR=HREF:/p/*
WAIT SECONDS=2

TAG POS=1 TYPE=A ATTR=CLASS:_2g7d5<SP>notranslate<SP>_95hvo EXTRACT=TXT
SET !VAR3 {{!EXTRACT}}

TAG POS=R1 TYPE=SPAN ATTR=TXT:* EXTRACT=HTM
SET !VAR1 {{!EXTRACT}}

TAG POS=1 TYPE=TIME ATTR=CLASS:_p29ma<SP>_6g6t5 EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}

TAG POS=1 TYPE=BUTTON ATTR=TXT:Close

WAIT SECONDS=1
SAVEAS TYPE=EXTRACT FOLDER=* FILE=Captions.csv

 

Leave a Reply

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