例如输入标签:
String html = "<html><head></head><body><input name='user'></input></body></html>";
Elements input = Jsoup.parse(html).select("input");
for (Element element : input)
System.out.println(Jsoup.parse(element.outerHtml());
结果:
<html><head></head><body><input name='user'/></body></html>
1)但有必要这样:
<html><head></head><body><input name='user'></input></body></html>
2)和as通过Jsoup来"<input.../>"
区分"<input...> </input...>"