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.

<iframe scrolling="Default" height="200" frameborder="0" width="450"
marginheight="0" marginwidth="0" src="registration.do"
name="VM_inl_commodity_all"></iframe>

<head>
<table>
<link href="favicon.ico" rel="shortcut icon">
<title>Commodities</title>
<table border="0" cellpadding="0" cellspacing="0">
  <tbody><tr>
      <td class="vmInlineList" valign="top"><img src="images/spacer.gif"
width="10" height="10"></td>
      <td class="vmInlineList"><input name="Button" value="Add to list"
class="vmBtnAddInline" onclick="parent.addCode(this,'000000','test1');"
type="button"></td>
      <td class="vmInlineList"><img src="images/spacer.gif" width="10"
height="10"></td>
      <td class="vmInlineList">000000- test1</td>
    </tr>

    <tr>
      <td class="vmInlineList" valign="top"><img src="images/spacer.gif"
width="10" height="10"></td>
      <td class="vmInlineList"><input name="Button" value="Add to list"
class="vmBtnAddInline" onclick="parent.addCode(this,'000002','test2');"
type="button"></td>
      <td class="vmInlineList"><img src="images/spacer.gif" width="10"
height="10"></td>
      <td class="vmInlineList">000002- test2</td>
    </tr>

    <tr>
      <td class="vmInlineList" valign="top"><img src="images/spacer.gif"
width="10" height="10"></td>
      <td class="vmInlineList"><input name="Button" value="Add to list"
class="vmBtnAddInline" onclick="parent.addCode(this,'000003','test3');"
type="button"></td>
      <td class="vmInlineList"><img src="images/spacer.gif" width="10"
height="10"></td>
      <td class="vmInlineList">000003- test3</td>
    </tr>
</tbody></table>
</form>
</body>

Attachments:
http://www.ruby-forum.com/attachment/4738/test.JPG

···

--
Posted via http://www.ruby-forum.com/.

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.

···

--
Posted via http://www.ruby-forum.com/\.

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

···

--
Posted via http://www.ruby-forum.com/.

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.

···

On Mon, May 17, 2010 at 8:07 AM, KingMaker KingMaker <sweetzubair@gmail.com> wrote:

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

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale