Retrieve page title from URL in Apps Script

2019-07-29 03:23发布

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?

1条回答
Viruses.
2楼-- · 2019-07-29 03:46

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 ?

查看更多
登录 后发表回答