I am using the following to collect all the links on a page and now
need to select a particular link to click on;

$browser.links.each do |l|
    #Relative link
    if (l.href.first == "/")
        $url = $browser.url + l.href[1..-1]
    else
        $url = l.href
    end
    if !$links.include?($url)
        $links.push $url
    end
end

The following finds the very first link but I need to find the first
link that contains a certain word;
$links.detect { |$links|   /^http/ =~ $links }

Have tried the line below but it gets confused because of the
extra //.
$links.detect { |$links|   /^http://word/ =~ $links }

Is it possible to tell watir/ruby to ignore the extra forward slashes?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to