Get Links in class with html agility pack
Posted
by acidzombie24
on Stack Overflow
See other posts from Stack Overflow
or by acidzombie24
Published on 2010-05-18T13:55:44Z
Indexed on
2010/05/18
14:00 UTC
Read the original article
Hit count: 156
htmlagilitypack
|c#
There are a bunch of tr's with the class alt. I want to get all the links (or the first of last) yet i cant figure out how with html agility pack.
I tried variants of a but i only get all the links or none. It doesnt seem to only get the one in the node which makes no sense since i am writing n.SelectNodes
html.LoadHtml(page);
var nS = html.DocumentNode.SelectNodes("//tr[@class='alt']");
foreach (var n in nS)
{
var aS = n.SelectNodes("a");
...
}
© Stack Overflow or respective owner