This blog is useful to all my friends who are working on the .Net Technology and wants to enhance their skills as well their problem solving ability.

Monday, February 8, 2016

how to find entire links of a website C#.net

Here's an example straight from their examples page on how to find all the links in a page

I'd look at using the Html Agility Pack.

 HtmlWeb hw = new HtmlWeb();
 HtmlDocument doc = hw.Load(/* url */);
 foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href]"))
 {

 }