[Wtr-general] How to access link in table cell?

Christian Baumann mail at chriss-baumann.de
Wed Oct 25 14:30:22 EDT 2006


Hello Charley,

thanks, that works fine.

Kind Regards,
Christian


Charley Baker schrieb:
> Hey Christian,
>
>   Try something along these lines:
>
> irb(main):019:0> require 'watir'
> irb(main):019:0> include Watir
> irb(main):019:0> ie = IE.start('http://www.google.com')
> => #<Watir::IE:0x2f2c480 ....
> # Get the table cell, pull the first link's href, there are a few
> links in this cell
> irb(main):020:0> link = ie.table(:index, 1)[1][1].link(:index, 1).href
> => "http://www.google.com/imghp?hl=en&tab=wi"
>
> -Charley
>
>
> On 10/25/06, Christian Baumann <mail at chriss-baumann.de> wrote:
>   
>> Hello!
>>
>> I have html-code like the following:
>>
>> === snip ===
>> <td><a href="http://www.happy.com/test.hmtl">text</a></td>
>> === snap ===
>>
>> Now my question: I want to get the value of the href-attribute within
>> this table-cell for further using. Any ideas/ suggestions how to get this?
>>
>> Thanks in advance,
>> Christian
>> _______________________________________________
>> Wtr-general mailing list
>> Wtr-general at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/wtr-general
>>
>>     
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>   



More information about the Wtr-general mailing list