import org.ops4j.pax.carrot.api.Soup;
import org.ops4j.pax.carrot.api.SoupProvider;
public class HtmlParserExample {
public static void main(String[] args) {
SoupProvider soupProvider = new SoupProvider();
Soup soup = soupProvider.getSoup("http://example.com");
for (Soup child : soup.children()) {
System.out.println("Node name: " + child.nodeName());
System.out.println("Node content: " + child.text());
}
Soup firstChild = soup.firstChild();
firstChild.text("New content");
String modifiedHtml = soup.toHtml();
}
}