title: How to run a Google Chrome script on a list of pages and put the results in a sheet?
body: <p>I have a list of IG hashtags and a script that extracts the min, max and the average number of likes from the top 9 posts of the hashtags, but I have to manually go to the tag page, open up the console, paste the script, and then copy/paste the results over to my sheet. Is there a way I can automate this so it is more efficient? I have no knowledge of code.</p>
  <p>This is the script</p>
  <pre><code>/* Hashtag Data */ 
  try {
      var data;
      try {
          data = _sharedData.entry_data.TagPage[0].graphql.hashtag
      } catch(a) {
          throw&quot;Cannot find hashtag page data. Try refreshing this web page (Ctrl/Cmd + Shift + R) to clear internal data storage, and run the data code again.&quot;
      }
      
      var size = data.edge_hashtag_to_media.count,
      top_posts = data.edge_hashtag_to_top_posts.edges,
      likes = top_posts.map(a =&gt; a.node.edge_liked_by.count),
      sum = likes.reduce((a, t) =&gt; a + t),
      avg = Math.round(sum/likes.length),
      min = Math.min.apply(null, likes),
      max = Math.max.apply(null, likes);
      console.log(`\n\n\n` + (size ? &quot;&quot; : &quot;This hashtag is BANNED, fyi!\n\n&quot;) + &quot;\n\n&quot; + size + &quot;\t&quot; + min + &quot;\t&quot; + avg + &quot;\t&quot; + max + &quot;\n\n&quot;)
  } catch(a) {
      console.error(`\n\nError: ${a}\n\n`)
  }
  </code></pre>