I am using my local Apache server and its address is 127.0.0.1. and I'm trying to load an html page from this server into a C # program using HTML Agility PACk but showing
ERROR: This path format is not supported.
HtmlAgilityPack.HtmlDocument docHtml = new HtmlAgilityPack.HtmlDocument(); docHtml.Load(@"htttp://127.0.0.1/2.htm"); // <--- error pointer showing here foreach(HtmlNode link in docHtml.DocumentNode.SelectNodes("//a[@href]")) { link.Attributes.Append("class","personal_info"); } docHtml.Save("testHTML.html"); }
Thank you very much @Slaks after your suggestion I changed my COde and its work Fine
HtmlAgilityPack.HtmlDocument docHtml = new HtmlAgilityPack.HtmlDocument(); HtmlAgilityPack.HtmlWeb docHFile = new HtmlWeb(); docHtml = docHFile.Load("http://127.0.0.1/2.html");
source share