This project has moved and is read-only. For the latest updates, please go here.

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:


    <!-- blank TD from Windows rowspan -->
  <a onclick="onDownload(this)" id="win-sdk" href="">installer_r20-windows.exe</a> (Recommended)
    <td>70497095 bytes</td>


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]");