Hi people, i will be short.
As far as i know watir library provides two methods for getting html elements.
Almost for each element (div, button, table, li, etc) watir provides two methods:
. One is the 'singular' method which gets only one specific element. For example:
watir_instance.div(:id,'my_div_id')
watir_instance.link(:href,'my_link_href')
watir_instance.button(:class =>'my_button_class', :index => 4)
These methods will only retrieve A SINGLE ELEMENT. Thats ok...
. The second is the 'plural' method that will retrieve ALL the elements of the watir instance
watir_instance.divs
watir_instance.links
watir_instance.buttons
But as far as i know watir doesn't provide a method to get more than one element giving certain conditions.
For example... If i want to flash all the links with id:my_link_id it would be very easy to do something like this:
watir_instance.divs(:id, 'my_link_id').each do |link|
link.flash
end
With hpricot this task is very easy... but if your aim is not to parse i couldn't find a Watir Method that does what i want.
Hope you can understand me...
Cheers, Juan!!