I have a google sheet with the following formula that works fine: =index(importxml("https://sullygnome.com/channel/xqcow/30","//div[@class='InfoStatPanelTLCell']"),1,1)
Trying to do it with google apps script but I get an error.
Using the following:
function parseXml() {
let url = "https://sullygnome.com/";
let data = UrlFetchApp.fetch(url).getContentText();
Logger.log(data);
}
I get this error:
Exception: Address unavailable: https://sullygnome.com/
parseXml @ Code.gs:3
Tried using the same code with google.com
instead and it worked:
function parseXml() {
let url = "https://google.com/";
let data = UrlFetchApp.fetch(url).getContentText();
Logger.log(data);
}
Any ideas how to tackle this? Thanks