jsoup clear方法:
document.getElementByTag("name").clear();
比如:<html style="font-size" .....></html>
document.getElementByTag("html").clear(); 结果就是,<html></html>;
本文详细介绍了 Jsoup 中的 clear 方法使用方式,演示了如何清除 HTML 标签内的所有属性和内容,使标签回到最原始状态。通过一个具体示例,展示了如何将带有样式属性的 html 标签清理为仅有基本结构的标签。
document.getElementByTag("name").clear();
比如:<html style="font-size" .....></html>
document.getElementByTag("html").clear(); 结果就是,<html></html>;
630
2006
1640

被折叠的 条评论
为什么被折叠?