Still working on this. Got as far as the body tag and into the header of the page I'm working on. But, surprise, the HTML is malformed. They failed to close an element. So I had to add a rule so that, if an ancestor element is closed, it treats that as implicitly closing the current element.
@madewokherd i wonder if a better architecture wouldn't be building this around headless chrome
@tbodt That would be a very different project.
@madewokherd the train of thought is, first it's just html, but someday you're probably going to find some website that needs to fetch the content with javascript, so maybe it does make sense to reuse all the browser crap but wrap it in a highly controlled layer. but that does make it a very different kind of project
@madewokherd obligatory embroidery troubleshooting page (header tag left open in each level) https://web.archive.org/web/20140310190221/http://www.sewingandembroiderywarehouse.com/embtrb.htm
Browsers don't care if your HTML is well-formed or not so this isn't surprising.