0

I hope that you guys are fine. I want to build a simple spreadsheet and I thought I could be able to make one but blank sheet looks horrible to me. I am sure that you guys are kind enough to help me out.

I want to perform multiple Google search queries in Google spreadsheet and want to parse results of each search (top 10 results of each search)

Something like this: https://www.youtube.com/watch?v=tBwEbuMRFlI

But when I tried his given formula in description to play test, Google returned #Error to me, I don't know why.

Can you guys please help me out in making a simple spreadsheet compatible for multiple queries at once? Like one column for keywords (where I could paste my list of keywords) and then 10 columns of search results. All results for one keyword should come in one row

Something like this:

My 1st Example Query = 1st search result, 2nd search result, 3rd result and so on. My 2nd Example Query = 1st search result, 2nd search result, 3rd result and so on.

It must be easy to code but yeah, it might be time-consuming and I would be very grateful if anyone of you could help me about it.

Looking forward to your help guys.

2 Answers2

0

The problem is that you want to scrape out of Spreadsheets, that's a bad approach and is almost certainly not going to work. Even if you manage to write a scraper inside that limited environment it will easily be spotted by Google.

As you said time is not a problem, I would suggest another route.

  1. Use a backend tool/script that scrapes the data
  2. Use a backend tool/script that creates/modifies the Google spreadsheet

You can run such a script(s) manually on your PC or from a server full automated using a scheduler/cron job.

To create/modify spreadsheets look here: How do I access the Google Spreadsheets API in PHP?
To scrape Google look here: Is it ok to scrape data from Google results?

So this is PHP as language of choice but you can do the exactly same in Java or Python or C#

Community
  • 1
  • 1
John
  • 7,507
  • 3
  • 52
  • 52
0

There is a third party solution like SerpApi you could use for this. It's a paid API with a free trial.

Google Sheets Add-on: SerpApi - Search Engine Results and Ranks

Example code to extract title from the first result:

=SERPAPI_RESULT("engine=google&q=coffee&location=Austin, Texas, United States&google_domain=google.com&gl=us&hl=en", "organic_results.0.title")

enter image description here

Milos Djurdjevic
  • 364
  • 1
  • 11