1

I am trying to scrape the number of likes on the most recent posts of an instagram account using REGEXREPLACE. The problem is that I am only getting the result of the most recent post, whereas I would like to get the result for ALL 12 most recent posts, ideally in separate cells. (When opening an IG profile on Chrome it shows the twelve most recent posts if one doesn't scroll down.)

Here's an example sheet https://docs.google.com/spreadsheets/d/1ZHByMU75DqvLx4kEIKfvjcGWuPCxgsF8eOhLouAdMpU/edit?usp=sharing

This is the formula I am currently using: =REGEXREPLACE(CONCATENATE(IMPORTDATA(https://www.instagram.com/natgeo)),"(^.likes: {""count"": )?(\d+)(}.)","$2")

The result is a number which is number of likes. How can I modify this to get all matches?

I tried playing with the regular expressions but couldn't figure it out. This thread may be helpful too: Multiple regex matches in Google Sheets formula

Thanks a lot!

Max Makhrov
  • 17,309
  • 5
  • 55
  • 81
Aldo
  • 11
  • 1
  • @Tom There is no script. OP uses the `IMPORTDATA` function to download the whole web page's source code and `REGEX` the likes. – TheMaster Nov 06 '17 at 19:55

0 Answers0