我正在尝试获取提要中的链接元素,我可以获取description
and title
,但无法获取该link
元素。我觉得很奇怪。这是我的代码
var url = "http://healthyhow.net/feed";
var response = UrlFetchApp.fetch(url);
var shareDoc = Xml.parse(response.getContentText(), true);
var root = shareDoc.getElement(); // feed element
var entries = root.getElement("channel").getElements("item");
for (var i=0; i<1; i++) { //just pick the first entry
var e = entries[i];
var title = e.getElement("title").getText();
var link = e.getElement("link").getText();
var description = e.getElement("description").getText();
}
谁能指出这里有什么问题?谢谢!