barsalou
2007-Mar-15 01:52 UTC
[Mechanize-users] SOLVED: Getting info from an Hpricot::Elem
I knew as soon as I hit the enter key, the intelligence would feed my brain. The answer to this is: elements[1]["value"] Easy Peasy....and why not? (there is a pun there if you can see it) Thanks for listening. Mike B. ----- Forwarded message from barjunk at attglobal.net ----- Date: Wed, 14 Mar 2007 17:49:57 -0800 From: barsalou <barjunk at attglobal.net> Reply-To: barsalou <barjunk at attglobal.net> Subject: Getting info from an Hpricot::Elem To: mechanize-users at rubyforge.org How about getting the name and value from this element object: irb(main):079:0> elements[1] => {emptyelem <input name="SNMPTrustedHost" type="hidden" value="1.2.3.4">} irb(main):080:0> elements[1].class => Hpricot::Elem If I can do that, then I''m home free. I''ve been looking at the Hpricot docs, but I''m not seeing what I need. Should I see the doctor if my vision gets blurred? :) Mike B. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ----- End forwarded message ----- ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.