http://www.perlmonks.org?node_id=293167


in reply to Javascript in Perl and retrieving the HTML source.

The JavaScript module may do what you want. I've never used it, and the version is 0.52 so it may be incomplete, but it says it's just a frontend to Mozilla's JavaScript libraries, so maybe it will work..