Hi Tommy,
Just to clarify, the only reason your code wasn’t working was because you were removing the node from the Document tree and then making the call to NextSibling, which would return null and cause the iteration to stop right after the first removial. You would need to first store the reference to the NextSibling in a temporary node before removing the original.
Also be aware a document can have many sections and therefore many bodies as well.
Thanks,
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.