【问题标题】:In Tritium, how do I remove text from a node?在 Tritium 中,如何从节点中删除文本?
【发布时间】:2013-06-04 16:28:04
【问题描述】:

我有一些结构如下的 HTML 内容:

<div> 
   random text I want to remove
   <span>Important Text #1</span>
   more text I want to remove
   <span>Important Text #2</span>
</div>

如何在保留重要内容的同时删除此 div 中的文本?

【问题讨论】:

    标签: moovweb tritium


    【解决方案1】:

    使用 remove_text_nodes() 删除文本。

    请查看此网址以获取解决方案:- http://tritium.moovweb.com/c3387d70958324469350596c6ef334a7da4ac4f1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-31
      • 2014-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-28
      • 2019-04-12
      • 2010-09-05
      相关资源
      最近更新 更多