Select an node by its value

Topics: Developer Forum, User Forum
Jul 2, 2012 at 12:19 AM
Edited Jul 2, 2012 at 12:19 AM

Hello guys!

I need to select an node by its value.

This is my HTML source:

 

  <tr>
    <!-- blank TD from Windows rowspan -->
    <td>
  <a onclick="onDownload(this)" id="win-sdk" href="http://dl.google.com/android/installer_r20-windows.exe">installer_r20-windows.exe</a> (Recommended)
    </td>
    <td>70497095 bytes</td>
    <td>0f25321554e2f88b247320d6a3bc1a7a</td>
  </tr>

 

I took it from Android SDK download page. I need to parse the link of this node, but there are 2 other nodes named "ID".

The only code I have so far is:

 

HtmlNodeCollection a = Links.DocumentNode.SelectNodes("//a[@id]")

I was trying to figure out by my own, reading the documentation, but I didn't found anything that led me to accomplish this. Can somebody help me?

Jul 6, 2012 at 10:14 PM
Edited Jul 6, 2012 at 10:14 PM

I believe this should do the trick.

HtmlNodeCollection a = Links.DocumentNode.SelectNodes("//a[@id or @href]");