![](/img/trans.png)
[英]How to fetch the URL of an uploaded IMAGE or VIDEO from a GOOGLE FORM using GOOGLE APP SCRIPT?
[英]Fetch title from url using Google App Script
我想在Google Spreadsheet上輸入一個網址,然后神奇地使用Google Apps腳本獲取標題。 你知道如何實現嗎?
您也可以在電子表格中執行importxml功能:
=IMPORTXML("URL","//title")
這是魔術;)
設置onEdit
觸發器,
function onEdit(e)
{
var url = e.value;
var urlData = UrlFetchApp.fetch(url).getContentText();
var xmldoc = Xml.parse(urlData, true);
var title = xmldoc.html.head.getElements("title")[0].getText();
Logger.log('URL Title: '+ title);
Browser.msgBox('URL Title: '+ title);
}
多田!
=HYPERLINK(IMPORTXML("https://www.https://en.wikipedia.org/wiki/Moon_landing";"//title"))
因此,您有一個突出顯示的,可單擊的超鏈接;)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.