0

I would like to scrape parts of a Redash query output and place it in a google sheets file.

Since I cannot use the function IMPORTXML(), I tried to write a script in Appscript. It seems to work with other websites, but not with Redash. Either because the function can only scrape HTML built sites or because Redash requires authentication to access the data, or any other issue I'm unaware of.

Does anyone know why this issue is ? And perhaps has a solution ?

Script below:

function scrapeWebpage() {
  var webURLtoscrap = "redash URL"
  var response = UrlFetchApp.fetch(webURLtoscrap);
  var $ = Cheerio.load(response.getContentText());
  var itemofinterest = $('.body-row widget-header').first().text().trim();
  return itemofinterest;
  }

Thanks !

0 Answers0