Created
February 17, 2018 11:42
-
-
Save joshi-kumar/47b5dd4acd3751db863d784ce762d073 to your computer and use it in GitHub Desktop.
Html file load changes and write in different file (read a html file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string epubPath = "D://reader/epubs/test.html"; | |
string epubPath1 = "D://reader/epubs/test1.html"; | |
HtmlDocument doc = new HtmlDocument(); | |
doc.Load(epubPath); | |
HtmlNode rootbody_node = doc.DocumentNode.Descendants("body").ElementAt(0); | |
HtmlNodeCollection body_elements = rootbody_node.ChildNodes; | |
if (body_elements.Count != 0) | |
{ | |
body_elements[0].SetAttributeValue("id", "Reached"); | |
} | |
doc.Save(epubPath1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment