phantomjs // render webpage from give dom

Problem

is there any chance to render/process a webpage just from the given DOM?
At the moment we can use page.open but just with a url. In my app i've got the DOM from somewhere else so there is no need to get it twice :)

I now that you can set the page content via page.content = "<html></html>" but i'm missing the callback for loaded images, etc.

Any Ideas out there?

Problem courtesy of: Jörn

Solution

Have a look at casperjs' bbcshot.js code sample, it does quite exactly what you're asking for.

Solution courtesy of: NiKo

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.