How to get the HTML until ?

Front end styling is usually a theme territory that plugins should avoid. There is no simple way to know how anything is styled without actually doing the full styling, as some of it will depend on the content itself, and since the styling is basically random from the plugin author POV, you are unlikely to be able to have a general algorithm to adjust it to whatever you need in a reliable way.

Best approach that comes into my mind is to wrap the content with your own div, and use JS to hide everything else on the page. Still you will most likely get a mobile type of vies in your lightbox, which might not be what you are after.