Hi,
I create a spreadsheet with 3 sheets, "Links", "Valid Links" and "Invalid links", then use the following code to check each row in the "Links" sheet, as below:
function myFunction() {
var rows = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Links").getDataRange().getValues();
rows.forEach(function(row, index)
{
if (index !== 0)
{
var url = row[1];
var page = UrlFetchApp.fetch(url).getContentText();
if (!number)
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Valid Links").appendRow(url);
else
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Invalid Links").appendRow(url);
}
});
}
However, when I debug to UrlFetchApp.fetch(url), the script suddenly aborts. No error or exception are shown. Why?