in reply to How to handle javascript

Analyze the script on a per-page basis, or use a mechanize clone that does do javascript.

Replies are listed 'Best First'.
Re^2: How to handle javascript
by gam3 (Curate) on Jan 28, 2007 at 03:39 UTC
    Javascript is not the problem it is access to the DOM. For simple javascript you can do something like this:
    our @URLS; my $runtime = JavaScript::Runtime->new();; my $context = $runtime->create_context(); $context->bind_function( name => 'open', func => sub { push(@URLS, @_); return 0; } );
    Then
    $context->eval(q(open("http://bob.com/")))
    will push http://bob.com/ onto @URLS.
    -- gam3
    A picture is worth a thousand words, but takes 200K.