Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能得到这样的文字:
<body> hi </body>
并使其大胆。我尝试了许多没有用的不同方法,主要是因为我尝试添加的标签
element.wrap();
被添加到错误的地方。
这对我有用:
String html = "<html><body>hi</body></html>"; Document doc = Jsoup.parse(html); Element body = doc.select("body").first(); body.html("<b>" + body.text() + "</b>");