I am using my local Apache Server and its address is 127.0.0.1 . and i trying to load html page from this server to C# programme using HTML Agility PACk but its showing
ERROR : The given path's 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 suggesion i Changed my COde and its working Fine
 HtmlAgilityPack.HtmlDocument docHtml = new HtmlAgilityPack.HtmlDocument();
        HtmlAgilityPack.HtmlWeb docHFile = new HtmlWeb();
        docHtml = docHFile.Load("http://127.0.0.1/2.html");
                doc.Load takes a path to a local file on disk.
You should use the HtmlWeb class:
HtmlDocument docHtml = new HtmlWeb().Load(url);
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With