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

Want to select one occurance not all

Jun 29, 2011 at 3:22 PM
Edited Jun 29, 2011 at 3:24 PM

Can Somone tell me how to get the following code working?

if (HtmlNode link in doc.DocumentNode.SelectSingleNode("//img]") != null) PathToImgs = link.Attributes["src"].Value;

I have this working chunk of code working but it selects all of the occurances of img's rather than a single (first) one I want.


foreach(HtmlNode link in doc.DocumentNode.SelectNodes("//img")) {


PathToImgs = link.Attributes["src"].Value;