in reply to Is Perl capable of doing this?

Maybe PhantomJS can do that. If it can, it is probably easier than any approach that uses Perl.