From: Hassan Schroeder Date: 2010-06-23T00:55:43+09:00 Subject: Re: Help with Ruby return types and documentation On Tue, Jun 22, 2010 at 7:57 AM, Tasos Laskos wrote: > But I'm stumped with Nokogiri's API. > > I can't figure anything out, I don't know what are the available methods > or attributes of a doc object, can't figure out how to get html "type", > "name" and "value" fields. Using irb to explore might help, e.g. doc = something something doc.methods But since you're apparently interested in form fields -- and to me, the doc is pretty obvious about this -- take a trivial example where 'doc' is a page with a form in it: >> inputs = doc.search('//input') => [#, #, #]>] >> inputs[0] => #, #, #]> By just looking at the above, I see this object has "attributes", so >> inputs[0].attributes['type'].to_s => "text" >> inputs[0].attributes['name'].to_s => "hsTotal" And so on... HTH! -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com twitter: @hassan