Separate your steps with /. Use two (//) if you don’t want to select direct children. Steps //div //div[@name='box'] //[@id='link'] A step may have an element name (div) and predicates ([...]). Both are optional. They can also be these other things: //a/text() #=> "Go home" //a/@href #=> "index.html" //a/* #=> All a's child elements Predicates Predicates //div[true()] //div[@class="head"] //div[@c