I want to change node's inner html in the document but the following code doesn't work unfortunately:
HtmlNodeCollection sourceTables = _sourceDoc.DocumentNode.SelectNodes("//table"); sourceTables.InnerHtml = "lalala";
The node's inner html changes properly, but it doesn't affect document html.
And this method doesn't work, because the node cannot be found:
This was a notable bug in the library (http://htmlagilitypack.codeplex.com/workitem/32959). It has been fixed very recently, at least in the source (it's not in the 1.4.6 release). You can do a get latest and recompile.