Trying to read titles from urls in google spreadsheet -
i've created function call title of given url google spreadsheets. now, seems inconsistent refresh code , works , following error same url worked previously:
typeerror: cannot read property "title" undefined.
i mean, links have titles not sure means? works, doesn't..
function grabtitle(url) { var response = urlfetchapp.fetch(url); var doc = xml.parse(response.getcontenttext(),true); var title = doc.html.head.title.gettext(); if (title == '') { return "unknown"; } else { return title; } }
Comments
Post a Comment