From: "Sarcar, Shourya C (GE Healthcare)" Date: 2008-11-10T23:28:11+09:00 Subject: Re: Watir: links with similar text in a page. How to access? > -----Original Message----- > From: mbaruah@spikesource.com [mailto:mbaruah@spikesource.com] > Sent: Monday, November 10, 2008 6:00 PM > To: ruby-talk ML > Subject: Re: Watir: links with similar text in a page. How to access? > > Attaching the portion of HTML that concerns. As described, I > need to click on the second text link, "Installation instructions". > > Attachments: > http://www.ruby-forum.com/attachment/2910/Watir-text-link.html > If you have any control over the generation of that HTML, you should change it to be more structured. Otherwise, a quick and dirty way would be: ie.links.each {|link| link.click if link.text =~ /Installation/}