@Test public void not() {

    Document doc = Jsoup.parse("<div id=1><p>One</p></div> <div id=2><p><span>Two</span></p></div>");
    Elements div1 = doc.select("div").not(":has(p > span)");
    assertEquals(1, div1.size());
    assertEquals("1", div1.first().id());
    Elements div2 = doc.select("div").not("#1");
    assertEquals(1, div2.size());
    assertEquals("2", div2.first().id());
}