|There's more than one way to do things|
Seek Perl equivalent to DOM Inspectorby jkeenan1 (Deacon)
|on Sep 28, 2013 at 22:07 UTC||Need Help??|
jkeenan1 has asked for the
wisdom of the Perl Monks concerning the following question:
Is there a Perl technique or a CPAN distribution which would enable me to capture the DOM of some executed HTML in the way that Safari Inspector or Firefox Web Inspector does?
Should this HTML ultimately be displayed on a browser that does not support scripting, the .gif will be displayed. But in all other cases the JS inside the <script> tag is executed and, ultimately, a Flash file is displayed.
I have tried using LWP::UserAgent to make the call. The call succeeds, but the HTTP::Response object simply contains the URL in the original call. However, when I execute this in a browser with developer tools, I get better results. In either Safari's Inspector or Firefox's Web Inspector, I can see what in Safari, at least, is labelled the DOM view of the result. More pseudo-code:
I want to capture this DOM view and parse it so that I can accurately identify the Flash file to the downstream server. If Safari and Firefox (and probably other browsers as well) can do this, my hunch is that Perl can do it as well. But I'm not primarily a web developer, so I turn to you.
Thank you very much.