Using a string instead of a document/url to load

c# html-agility-pack

Question

I just found out about html agility pack and I tried it, but stumbled upon a problem. I couldn't find anything on the web so I am trying here.

Do you know how I can load the HTML from a string instead of document/URL?

Thanks.

1
23
9/7/2018 1:58:01 PM

Accepted Answer

Have you tried using LoadHtml?

string htmlString = 'Your html string here...';

HtmlAgilityPack.HtmlDocument htmlDocument = new HtmlAgilityPack.HtmlDocument();
htmlDocument.LoadHtml(htmlString);

// Do whatever with htmlDocument here
55
2/27/2012 1:30:18 AM

Popular Answer

i think there's a function to do that right?

HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml("<test>");


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow