Given the code below:
HTML:
a
b
c&
This should help you:
public class TestJsoup {
public static void main(String[] args) {
try {
Document doc = Jsoup.connect("http://www.google.ro").get();
Elements select = doc.select("div");
System.out.println(select.size());
select.remove(1);
System.out.println(select.size());
} catch (IOException ex) {
Logger.getLogger(TestJsoup.class.getName()).log(Level.SEVERE, null, ex);
}
}
}