Import Google Search Results Using Importxml

I want to use Google Sheets to grab Google search results's number. My formula is:

=ImportXML(URL,"//div[@id='resultStats']")

=IMPORTXML("";"//div[@id='resultStats']")

Google Sheets always returns #N/A, is there something wrong with the formula? I think the problem is in the url, but I don't have solution.

3

1 Answer

Answer is here: importxml in google docs and returning a google search result

Google has lately been blocking search requests made from both Apps Scripts and Google Sheets though the requests are made from one of their own IPs. They probably do this to prevent scraping.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest