0
Google Apps Script의 콘텐츠에서 HTML 태그를 스트라이프하는 방법을 찾고 있습니다. 지금은 HTML 구문 분석에 이러한 기능을 사용하고 들어Google Apps Script의 스트라이프 HTML 태그
:
function getTextFromHtml(body) {
return getTextFromNode(Xml.parse(body, true).getElement());
}
function getTextFromNode(x) {
switch(x.toString()) {
case 'XmlText': return x.toXmlString();
case 'XmlElement': return x.getNodes().map(getTextFromNode).join('');
default: return '';
}
}
그러나 긴 HTML의이 방법에 대한
은 너무 비효율적이다.샘플 HTML 내용 : http://pastebin.com/FmB4hvN2
어떤 아이디어?
할 수 있습니다! 감사! – Labradorcode