schnibitz has asked for the wisdom of the Perl Monks concerning the following question:

Monks,
Note the code below. This code is supposed to help me handle pages with javascript redirects. BUT when it reads the redirect and follows it, it continues processing javascript on the destination page (that the redirect pointed it to). I don't want that. I want it to not interpret javascript on the destination page (for performance reasons). Please tell me there's some sort of hack that might make this possible.

I thought some sort of loop might do the trick, but I think that the reload is taking place somewhere within the module, where a loop in the below code won't affect it.

But if anyone can solve it, they'll be here. What do you all think?

-S

--------------------------snip--------------- #!/usr/bin/perl use WWW::Scripter; $w = new WWW::Scripter; $w->use_plugin('JavaScript'); #$w->use_plugin('Ajax'); $w->agent_alias( 'Windows IE 6' ); $w->get("http://www.withjavascriptredirect.com");

Replies are listed 'Best First'.
Re: Turning Javascript off with WWW::Scripter
by Anonymous Monk on Aug 01, 2010 at 06:34 UTC
    I think you're going to have to write your own script_handler or script plugin (subclass WWW::Scripter::Plugin::JavaScript)