Scrape Instagram users from a hashtag into a Google Sheet


How to scrape Instagram users from a hashtag into a Google Sheet: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.

Here is how the automation works. To scrape Instagram users from a hashtag, collect the post links on the hashtag page with Get a list of links to pages from a URL, loop through them with Loop through data, and on each post collect the profile link with Get a list of links to pages from bot's current page, writing the post URL and profile link to a Google Sheet with Write data to a Google Sheet. The profile link holds the handle.

Author
Alex Barlow
Published

Build the Instagram hashtag user scraper from a description


Describe it and click the button: the agent builds and tests the scraper in your Chrome extension. Runs use your own logged-in Instagram in Chrome, on the desktop app; for a cloud run, see logins.

  1. Open the Instagram hashtag page in my Google Sheet
  2. Collect the links to every post on it
  3. Open each post and get the poster's profile link
  4. Write the post and profile links to my sheet
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

You need a Google Sheet with the hashtag page's URL in it, for example https://www.instagram.com/explore/tags/beach/, and a sheet to write to; the agent asks you for both. Leave the sheet alone while the run adds to it.

The video shows the agent building the Instagram hashtag user scraper from the four lines above, in a few minutes.

Build the Instagram hashtag user scraper step by step


The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.

  • 1.0 Get a list of links to pages from a URL
  • 2.0 Loop through data
    • repeats for every row in [scraped-link-data]
    • 2.1 Go to page
      • URL: the link column of [scraped-link-data]
    • 2.2 Wait
      • Wait time: 2000
    • 2.3 Get current bot URL
    • 2.4 Get a list of links to pages from bot's current page
      • Select: the poster's name at the top of the post
    • 2.5 Append or merge data
      • Data A: [current-url]
      • Data B: [scraped-link-data], the profile link
    • 2.6 Write data to a Google Sheet
      • Spreadsheet: your sheet
      • DATA: [appended-data]
      • Write options: Add to existing data

Common questions about scraping Instagram users from a hashtag


Why does the Instagram hashtag page load nothing?

The URL is wrong or Instagram is signed out. Check URL on the first step is a hashtag page, https://www.instagram.com/explore/tags/<tag>/, and that Instagram is signed in in Chrome.

Why are not all the posts on the hashtag collected?

Instagram loads more posts as you scroll. Raise Max results and add a scroll before the collection if the page needs it. When a run fails, hand it to the agent and it repairs the step.

The selector no longer matches the poster's name. Open a post and reselect the poster's name in Get a list of links to pages from bot's current page, or use a custom selector.

Can I scrape Instagram users from a hashtag without code?

Yes. The automation opens the hashtag page and each post in your own browser and reads the links off them, so there is no Instagram API or script; the agent builds it from the lines above.

Can I message or follow the Instagram users it finds?

Yes. Feed the sheet to send Instagram DMs from a Google Sheet. Keep to Instagram's limits.

Can I save the Instagram users to Excel instead of a Google Sheet?

Yes. Swap Write data to a Google Sheet for Write data to an Excel Sheet, with [appended-data] as the data.

Can I scrape only the post links from a hashtag?

Yes. Keep the first step and write [scraped-link-data] to the sheet, without the loop. To collect post links for a list of search terms instead, see scrape Instagram post links for every search term in a Google Sheet.

Where do I get help?

Get in touch with support, or ask in the axiom.ai community.

Related guides