Skip to content

Instantly share code, notes, and snippets.

@interdigitize
Last active March 30, 2020 07:33
Show Gist options
  • Save interdigitize/fb23d7491827d48351e655d67ce228f9 to your computer and use it in GitHub Desktop.
Save interdigitize/fb23d7491827d48351e655d67ce228f9 to your computer and use it in GitHub Desktop.
Scrape and save data to Google Sheets with Apps Script - fetch site content
var url = "http://publichealth.lacounty.gov/media/Coronavirus/locations.htm"
//fetch site content
var websiteContent = UrlFetchApp.fetch(url).getContentText();
var fetchTime = Utilities.formatDate(new Date(), 'Etc/GMT', "yyyy-MM-dd HH:mm:ssZ"); // "yyyy-MM-dd'T'HH:mm:ss'Z'"
Logger.log('website content: ' + websiteContent);
Logger.log('fetch time: ' + fetchTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment