I have the outerHTML of the html tag in a string and want to extract the inner HTML the body tag. The function is used in C#, so I don't have access to any HTML/JavaScript Dom functionality, similar to How do i grab everything inside the BODY html tag (From a string) using RegEx Asp.net C# .
The HTML Agility route won't work because of the differences in the HTML document that occur doing the LoadHtml conversion. I capture differences the original HTML body and the HTML body as it updates on a live site. I want those differences to be compared to the original body innerHTML. The reason I want to extract the body innerHTML from the HTML outerHTML is to space on data transfer, (one transmit of html, head and body, instead of a transmit of each.
Ideally this would handle any edge case, such as attributes in the body tag, invalid html is the body tag, ect.