Reputation: 1
I'm trying to create a personal notifier whenever a certain website contains the word 'Indian' the script should email me. For some reason I cannot find a script function that would import HTML data,
Is there such a function?
Upvotes: 0
Views: 6718
Reputation:
Just like Harold said, you can perform a URL fetch:
var output = UrlFetchApp.fetch("https://raw.githubusercontent.com/####");
var form = HtmlService.createHtmlOutput(output.getContentText());
SpreadsheetApp.getUI().showModalDialog(form, "Fetched HTML");
You can otherwise fetch a website using the same tactic, for example:
var output = UrlFetchApp.fetch("https://www.google.com");
var form = HtmlService.createHtmlOutput(output.getContentText());
SpreadsheetApp.getUI().showModalDialog(form, "Fetched HTML");
Upon launch, the dialog should return Google's homepage.
Upvotes: 0
Reputation: 3337
Yes, you can perform a URL fetch:
https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String)
Upvotes: 1