How to scrape Instagram hashtag pages for handles and post links

This template scrapes Instagram hashtag pages using a bot. The bot opens a hashtag page in Chrome, collects links to all posts, and then extracts each user's handle and profile link. It records the post URLs, handles, and profile URLs into a Google Sheet

# Get started: Set up your Google Sheet

Create a new Google Sheet. You can do this in your Chrome browser by entering the shortcut 'sheet.new', assuming you already have an account. Name your sheet something like 'Instagram hashtag data’.

# Install the Instagram hashtag bot

To install this Instagram handle scraper entry bot click 'Install template'. If you’re a new user, you’ll have to click 'Install Chrome extension' and create a free Axiom.ai account before you can edit the template.

Once installed, click 'Start'.

Axiom.ai will guide you through the steps you need to configure in the app.

# Configure your Instagram hashtag bot in two easy steps

  • Step 1.0 - Get a list of links to pages from a URL
    • URL - Insert a Instagram hashtag URL for example 'instagram.com/explore/tags/beach/'.
    • Max results - Set the amount of posts to scrape
  • Step 2.0 - Loop through data
    • Step 2.1 - Go to page
      • Preconfigured - Loops through scraped post links
    • Step 2.2 - Loop through data
      • Step 2.2.1- Current Url
        • Preconfigured - Gets pust URL
      • Step 2.2.2 - Get a list of links to pages from bot's current page
        • Preconfigured - Scrapes handle and profile link
    • Step 2.5 - Write data to a Google sheet
      • Spreadsheet - Search for the Google Sheet you created. Once found, click to select
      • Sheet name - Set the sheet name

# Run your Instagram hashtag bot

To test the Instagram hashtag bot in 'Step 1' adjust the 'max results' to a low number, initiate the bot with the desktop runner and let it run a few loops. Then, stop the bot and review the data in the linked Google Sheet. If you wish to schedule the bot add steps to login.

# Customize your template

Like all Axiom templates, you can use our no-code bot builder to customize any bot according to your requirements.

# Tips

We recommend you watch the video to troubleshoot. If you wish to schedule the bot you will need to share the Cookie in settings or add steps to login.

  • Step 1.0 - Get a list of links to pages from a URL
    • Not loading Instagram? Make sure you have added an Instagram hashtag URL
    • Not scraping all posts? Check 'Max results'
  • Step 2.0 - Loop through data
    • Step 2.1 - Go to page
      • Not looping through scraped links? Make sure 'Data' is set to '[Scraped-link-data]'
    • Step 2.2 - Loop through data
      • Step 2.2.2 - Get a list of links to pages from bot's current page
        • Selectors not work? Re-select try custom selectors if that fails
    • Step 2.5 - Write data to a Google sheet
      • No data? Make sure 'Data' is set to '[all-interaction-data_1]'

We offer excellent customer support. If you need help, get in touch.

# More Templates