mfugle-1
March 5th, 2008, 02:25 PM
Hello,
Does anybody know how to click a link using Ruby Watir, when the HTML looks like this:
<tr class="odd">
<td width="14%">Anderssen, Rannei</td>
<td width="3%" style="text-align: center;">K</td>
<td width="15%">Bryn Legesenter</td>
<td width="3%" style="text-align: center;">
Ja
</td>
<td width="14%">Kirkegårdsvn. 3</td>
<td width="10%">1348 Rykkinn</td>
<td width="3%" style="text-align: center;">
Ja
</td>
<td width="3%" style="text-align: center;">
Nei
</td>
<td width="5%" style="text-align: right;">1199</td>
<td width="5%" style="text-align: right;">1</td>
<td width="5%">
<a name="sokresultat"
href="/minfastlege/innbygger/velgfastlege.do?type=LE&lopenr=3810&kommunenr=0219 &praksistype=FL&praksisfomdato=01052001">
Velg
</a>
</div>
</td></tr>
The link I want to click is above were it is stated 'Velg', this is what is displayed on the web page.
The webpage contains a list og instances were the one above is one of the many instances. What makes the instance unique is the lopenr=3810 in the URL.
I think something like
ie.link(:href, "3810").click could work but it does not.
Is there a way to say (in pseudo-code):
"Click the link where lopenr=3810"
I hope you understand what I am saying here :)
Cheers!
Magnus
Does anybody know how to click a link using Ruby Watir, when the HTML looks like this:
<tr class="odd">
<td width="14%">Anderssen, Rannei</td>
<td width="3%" style="text-align: center;">K</td>
<td width="15%">Bryn Legesenter</td>
<td width="3%" style="text-align: center;">
Ja
</td>
<td width="14%">Kirkegårdsvn. 3</td>
<td width="10%">1348 Rykkinn</td>
<td width="3%" style="text-align: center;">
Ja
</td>
<td width="3%" style="text-align: center;">
Nei
</td>
<td width="5%" style="text-align: right;">1199</td>
<td width="5%" style="text-align: right;">1</td>
<td width="5%">
<a name="sokresultat"
href="/minfastlege/innbygger/velgfastlege.do?type=LE&lopenr=3810&kommunenr=0219 &praksistype=FL&praksisfomdato=01052001">
Velg
</a>
</div>
</td></tr>
The link I want to click is above were it is stated 'Velg', this is what is displayed on the web page.
The webpage contains a list og instances were the one above is one of the many instances. What makes the instance unique is the lopenr=3810 in the URL.
I think something like
ie.link(:href, "3810").click could work but it does not.
Is there a way to say (in pseudo-code):
"Click the link where lopenr=3810"
I hope you understand what I am saying here :)
Cheers!
Magnus