Pick the value from the table

Hello Friends,

Help me to pick value from the tables.i m confused because of the button
name and id is same for the all button.

i attached the snap short of the table.have a look.

Commodities
<tr>
  <td class="vmInlineList" valign="top"><img src="images/spacer.gif"

width=“10” height=“10”>




<tr>
  <td class="vmInlineList" valign="top"><img src="images/spacer.gif"

width=“10” height=“10”>




000000- test1
000002- test2 000003- test3

KingMaker KingMaker wrote:

Help me to pick value from the tables.i m confused because of the button
name and id is same for the all button.

What are you using to parse the web page: Nokogiri? Mechanize? Hpricot?

Using one of these, you should be able to use CSS or XPATH selectors to
select the nth row, and/or iterate over all the rows of the table so you
can process each one in turn.

I dont know because i m new in ruby.
dont know how to get value from html table.

On Mon, May 17, 2010 at 8:07 AM, KingMaker KingMaker
[email protected] wrote:

I dont know because i m new in ruby.
dont know how to get value from html table.

For those of us who know Ruby, it’s very difficult to decipher what
you are actually trying to do.

What do you mean pick “the value”. Which value?

In what context are you doing this? Brian’s answer was, I think, based
on the assumption that you are somehow trying to parse this xml/xhtml
in Ruby, and he suggested looking at one of the several xml parsing
libraries for Ruby, the most popular being nokogiri.

On the other hand maybe you’re trying to ‘pick’ the right button to
push for some kind of automated testing, using say webrat.

In any case I suspect that this is more of a css/xpath selector
question than a Ruby question, but from the little you’ve told us so
far it’s hard, if not impossible to tell.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: rubyredrick (Rick DeNatale) · GitHub
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale