如何在不转义的情况下将文本放入Element
对象?
Document doc = Jsoup.parse(htmlFile, StandardCharsets.UTF_8.name());
Elements els = doc.select("script");
for(Element element: else) {
element.text("Text that should not be escaped. eq '&'");
}
答案 0 :(得分:0)
import org.jsoup.nodes.DataNode;
element.empty();
element.appendChild(new DataNode("Text that should not be escaped. eq '&'"));