Wise ones:

WWW::Robot seems to work well for following URLs of various types as long as they are type http. But I am getting confused as to where I would set up the ability to follow a link that uses JavaScript to open.window example html/JS further below).

My instance of WWW::Robot is similar to most that I see out there. Can anyone point me to a good source of info on this? Many thanks.

... my $robot = WWW::Robot->new ( NAME => 'UsageBot', VERSION => '1.0', EMAIL => 'me@myaddress.com', USERAGENT => LWP::UserAgent->new, CHECK_MIME_TYPES => 0, IGNORE_TEXT => 0 ); $robot->addHook ("follow-url-test" => sub { my ($robot, $hook, $url) = @_; return 0 unless $url->scheme eq 'http'; OK_TO_FOLLOW($url); });

Doesn't seem to follow existing HTML like this:

<a href="#" onClick="popWindow('usage')"...>...</a> function popWindow(wintype){ if (wintype == "usage"){window.open 'usage_stats.html', 'server_stat...)...}

In reply to WWW:Robot to follow links through JavaScript by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.