Last active
April 4, 2020 06:40
-
-
Save interdigitize/da28655e86ee4e40a746dc5052e6adba to your computer and use it in GitHub Desktop.
Scrape and save data to Google Sheets with Apps Script - extract data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//extract data | |
var laCasesRegExp = new RegExp(/(Laboratory Confirmed Cases \(LCC\))([tdh<>\/]+)([0-9]+)/m); | |
var laDeathsRegExp = new RegExp(/(Deaths)([tdh<>\/]+)([0-9]+)/m); | |
var laCasesMatchText = laCasesRegExp.exec(websiteContent); | |
Logger.log('LA cases: ' + laCasesMatchText[3]); | |
var laDeathsMatchText = laDeathsRegExp.exec(websiteContent); | |
Logger.log('LA deaths: ' + laDeathsMatchText[3]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment