Karol
Karol

Reputation: 1

Error on importxml function in Google Spreadsheet while scraping Google

I am trying to scrape some Google Search results to my Google Spreadsheet using function:

=importxml("https://www.google.pl/search?q=Arsenal";"//title")

and I'm facing error: "Could not fetch URL" all the time.

I was trying with different Google Search Results Pages, different HTML tags

Upvotes: 0

Views: 565

Answers (1)

user6655984
user6655984

Reputation:

Google does not want their search pages to be scraped. In particular, it won't let you scrape them using their own Sheets functionality.

To access Google search results from Sheets, you will need to write an Apps Script using their search API. An example is here.

Upvotes: 0

Related Questions