public static void Main()
<h1>Thisd is <b>bold</b> heading</h1>
<p>This is <u>underlined</u> paragraph</p>
<h1>This is <i>italic</i> heading</h1>
<p>This is <u>underlined</u> paragraph</p>
<img src=""/image.jpg""/>
var htmlDoc = new HtmlDocument();
htmlDoc.OptionOutputOriginalCase = true;
htmlDoc.OptionWriteEmptyNodes=true;
var htmlNodes = htmlDoc.DocumentNode.SelectNodes("//body/img");
foreach (var node in htmlNodes)
node.Attributes.Add("width","100px");
Console.WriteLine(node.OuterHtml);
htmlDoc.DocumentNode.InnerHtml = htmlDoc.DocumentNode.InnerHtml.Replace("100px","50px");
var str=htmlDoc.DocumentNode.OuterHtml;
Console.WriteLine("\n----------------------------------\n Whole document content\n\n"+str);