Chobeat
Chobeat

Reputation: 3525

Retrieve page title from URL in Apps Script

i need to retrieve the page title from an URL i already have using Apps Script.

  var url= r.getValue();
  var title= magically_retrieve_title(url);
  setTitle(title)

How can i do that?

Upvotes: 1

Views: 1048

Answers (1)

Srik
Srik

Reputation: 7965

If you want to get the title of the page at a 'normal' URL, then you can get the contents of the page using UrlFetchApp.fetch(url) and then parse the title tag.

If not, then please provide more information- what is r here ? What sort of URL are you working with ?

Upvotes: 5

Related Questions