From: "R.. Kumar 1.9.1 OSX" Date: 2010-08-09T00:35:28+09:00 Subject: Nokogiri help I am trying to access some particular children in a document. I find myself having to loop (several levels) through children checking name == "xxx". I am wondering whething there is more direct way of getting the same. Here's a simple sample. I am trying to get the href of a class called prevnext (on browser it is "next"). require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.reddit.com/r/programming/')) nextlink = nil doc.css('p.nextprev').each do |link| link.children.each do |child| if child.name == "a" nextlink = child.attributes["href"].value end end end puts nextlink -------- Can i not access a.href more directly in the doc.css line itself ? thx, rahul -- Posted via http://www.ruby-forum.com/.