a
b
c
$("p", 0) // a $("p", 2) // c $("p", 0..1) // a & b $("p", 1..2) // b & cp1
p2
p1
p2
p1
p2
$("p", attr1: "a") $("p", attr2: "c") $("p", attr1: "a", attr2: "b") $("p", text: "p1") $("p", text: "p1", attr1: "a") $("p", text: ~/p./) $("p", text: startsWith("p")) $("p", text: endsWith("2")) Attribute/Text Matching1
2
Navigators are collections of collections (like jQuery) $("p").max { it.text() }.text() == "2" $("p").each { println it.text() } includes all the cool Groovy collection methods