[iMacros] Instagram bio scraper, url and email address extractor

HoNeYBiRD

Elite Member
Joined
May 1, 2009
Messages
10,187
Reaction score
12,580
[iMacros] Instagram bio scraper, url and email address extractor


Instagram bio scraper (via instagram.com)
The macro scrapes the full bios of selected usernames.
Code:
TAB T=1
TAB CLOSEALLOTHERS
SET !ERRORIGNORE YES
SET !DATASOURCE c:\Users\...\Documents\iMacros\DataSources\usernames.txt
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO
ADD !EXTRACT {{!COL1}}
URL GOTO=https://www.instagram.com/{{!COL1}}
TAG POS=1 TYPE=DIV ATTR=TXT:*&&CLASS:_tb97a EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=bios.csv
SET !EXTRACT NULL
Result:
- bios.csv (column A: username; column B: bio) saved into the Downloads folder of your iMacros installation.

Instagram url extractor (via websta.me and hosted Email Extractor Lite 1.8.1)
The macro extracts the urls from the bios/website fields of selected usernames.
Code:
TAB T=1
TAB CLOSEALLOTHERS
SET !ERRORIGNORE YES
SET !DATASOURCE c:\Users\...\Documents\iMacros\DataSources\usernames.txt
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO
URL GOTO=https://websta.me/n/{{!COL1}}
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
URL GOTO=http://www.eel.surf7.net.my/
TAG POS=1 TYPE=SELECT FORM=NAME:extractor ATTR=NAME:address_type CONTENT=%web
TAG POS=1 TYPE=TEXTAREA FORM=NAME:extractor ATTR=NAME:input CONTENT={{!EXTRACT}}
SET !EXTRACT NULL
ADD !EXTRACT {{!COL1}}
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:extractor ATTR=CLASS:button
TAG POS=1 TYPE=TEXTAREA FORM=NAME:extractor ATTR=NAME:output EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=urls.csv
SET !EXTRACT NULL
Result:
- urls.csv (column A: username; column B: url) saved into the Downloads folder of your iMacros installation. When there's no url found in the bio of a certain user, a "none" entry is placed in column B.

Instagram email address extractor (via websta.me and hosted Email Extractor Lite 1.8.1)
The macro extracts the email addresses from the bios of selected usernames.
Code:
TAB T=1
TAB CLOSEALLOTHERS
SET !ERRORIGNORE YES
SET !DATASOURCE c:\Users\...\Documents\iMacros\DataSources\usernames.txt
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO
URL GOTO=https://websta.me/n/{{!COL1}}
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
URL GOTO=http://www.eel.surf7.net.my/
TAG POS=1 TYPE=TEXTAREA FORM=NAME:extractor ATTR=NAME:input CONTENT={{!EXTRACT}}
SET !EXTRACT NULL
ADD !EXTRACT {{!COL1}}
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:extractor ATTR=CLASS:button
TAG POS=1 TYPE=TEXTAREA FORM=NAME:extractor ATTR=NAME:output EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=email_addresses.csv
SET !EXTRACT NULL
Result:
- email_addresses.csv (column A: username; column B: email address) saved into the Downloads folder of your iMacros installation. When there's no email address found in the bio of a certain user, a "none" entry is placed in column B.

Guidelines:
(1) Create a usernames.txt file in the DataSources folder of your iMacros installation. This folder normally can be found at c:\Users\YourWindowsUsername\Documents\iMacros\DataSources\. Place one username per line. This is the data source for all three macros.
(2) Change the file path in 4th line of the codes to the full path of your usernames.txt file you just created.
(3) Play the macros in loop. Loop count equals to the amount of usernames/lines in your usernames.txt file.

Neither of the macros require Instagram login.
Safety precaution: before starting the macros log out of your Instagram account and you might want to use a proxy/VPN too to not get your ip address blocked/rate limited or insert proper delays into the macros.

Disclaimer: I made these macros using the standalone iMacros Browser, they might not work with the Firefox or Chrome addon without modification.
 
Instagram 'date of last post' extractor (via websta.me)
The macro extracts the date of the last post of desired usernames. It can come in handy when you want to determine account activity.
Code:
TAB T=1
TAB CLOSEALLOTHERS
SET !ERRORIGNORE YES
SET !DATASOURCE c:\Users\...\Documents\iMacros\DataSources\usernames.txt
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT NULL
SET !EXTRACT_TEST_POPUP NO
ADD !EXTRACT {{!COL1}}
URL GOTO=https://websta.me/n/{{!COL1}}
WAIT SECONDS=1
TAG POS=2 TYPE=SMALL ATTR=TXT:Posted:* EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=date_of_last_post.csv
SET !EXTRACT NULL
WAIT SECONDS=1

Result:
- date_of_last_post.csv (column A: username; column B: date of last post) saved into the Downloads folder of your iMacros installation. When there's no post found of a certain user (users with 0 post), an "#EANF#" entry is placed in column B.

Guidelines:
(1) Create a usernames.txt file in the DataSources folder of your iMacros installation. This folder normally can be found at c:\Users\YourWindowsUsername\Documents\iMacros\DataSources\. Place one username per line. This is the data source for the macro.
(2) Change the file path in 4th line of the code to the full path of your usernames.txt file you just created.
(3) Play the macros in loop. Loop count equals to the amount of usernames/lines in your usernames.txt file.

The macro doesn't require Instagram login, however if you want to scrape the data from those private users who accepted your follow request, you need to be logged in.

Disclaimer: I made this macro using the standalone iMacros Browser, it might not work without modification with the browser addon versions of iMacros.
 
Back
Top