Iframes, while not perfect, are pretty close though...
Making iframes be the right size is super awkward. I might actually use them more if they were easy to get responsive.
This post does link to a technique (new to me) to extract iframe contents:
<iframe src="/example.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
Iframes fundamentally encapsulate html documents, not fragments.
Interaction between elements in different iframes is very restricted.
Making iframes be the right size is super awkward. I might actually use them more if they were easy to get responsive.
This post does link to a technique (new to me) to extract iframe contents: