I want to retrieve the value of href attribute
Posted: Thu Feb 25, 2010 9:53 am
I want to retrieve the value of href tag and then navigate to the page and retrieve some other data.
Please find attached a snippet,
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://www.xyz.com" target="abc"></a></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://www.pqr.com" target="mnp"></a></td>
</tr>
</table>
I am currently using loadHTML() to parse the results for <tr> and <td> tags but i am unable to parse the href attribute of <a> tag. How can we get the value of href attribute i.e. http://www.xyz.com in this case?
Please find attached a snippet,
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://www.xyz.com" target="abc"></a></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://www.pqr.com" target="mnp"></a></td>
</tr>
</table>
I am currently using loadHTML() to parse the results for <tr> and <td> tags but i am unable to parse the href attribute of <a> tag. How can we get the value of href attribute i.e. http://www.xyz.com in this case?