On this spreadsheet, the Apps Script returns the right result when I run it, the execution log correctly returns "202000.0".
However, when I run the script in a cell (highlighted in orange on the linked spreadsheet), the cell is empty, does anyone know how to fix this by any chance?
The Apps Script code:
function fullTimeEmployees(url) {
var url = 'https://finance.yahoo.com/quote/WBA/profile'
var source = UrlFetchApp.fetch(url).getContentText()
var jsonString = source.match(/root.App.main = ([\s\S\w]+?);\n/)
if (!jsonString || jsonString.length == 1) return;
var data = JSON.parse(jsonString[1].trim())
Logger.log(data.context.dispatcher.stores.QuoteSummaryStore.assetProfile.fullTimeEmployees)
}
Also, does anyone know what I can change .fulltimeEmployees (at the end) to so it returns the full company name? as pictured here, highlighted in green