I have an html that i need to extract just a div and the elements inside this div but as a string.
<div id=01>
<div id-02>
<label></labell>
<input></input>
//etc
</div>
</div>
How do i get all inside the div 01 as a single string?
The only way i found is to get using the nodes, but it returns me a collection of HtmlNodes.
document.DocumentNode.SelectNodes("//*[contains(@class,'container')]").Descendants("div").Select(p => p.OuterHtml);
var Node = document.DocumentNode.SelectNodes("//div[@id='01']").SingleOrDefault();
var target = Node.InnerHtml;
becouse id is single I used SingleOrDefault for this id