Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Extract href by anchor text?

$
0
0
I see that this was never answer, but just in case someone else is looking for answer, here is one way of doing it:

var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml({yourHtmlContentOrFile});
var rootNode = htmlDoc.DocumentNode;
var refs = rootNode.SelectNodes("//*/a/@href");
var link =refs.ElementAt(0).Attributes["href"].Value;

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>