Reputation: 79
I have a list of about 200 URLs and I want to check whether they are working or bring an error. Is there a script or a formula I can use that can show me whether a link is broken?
Upvotes: 0
Views: 60
Reputation: 1
use:
function URLCHECK(url){
var options = {
'muteHttpExceptions': true,
'followRedirects': false
};
var url_trimmed = url.trim();
var response = UrlFetchApp.fetch(url_trimmed, options);
return response.getResponseCode();
}
and formula:
=IF(URLCHECK(A2)>=400, "broken", "ok")
Upvotes: 1