importxml in google docs and returning a google se

2019-09-13 10:56发布

问题:

I am trying to upload a result of a google search into my google docs using importxml and the code that used to work doesn't anymore. I have =IMPORTXML("https://www.google.com/search?q=site: [query]&num=100&start=1","//cite")

My error message is Could not fetch url: https://www.google.com/search?q=site:[query]&num=100&start=1

Can someone tell me why this doesn't work anymore?

回答1:

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.