TokeParser does not see javascript links ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a question reg. the Tokeparser. It does not seem to "find" links
(<a...> tags) that does not have a valid url.

In the URL below, there are links that look like

<a href="javascript:;" onclick="popupOTL(568,'{8C465561-A0CB-440B-A02E-
053329F76EB6}',0,880,676,false,'0');setWatched(this);">Long document

Yet, the TokeParser completely ignores that link. Why ?

Any help appreciated


#!/usr/bin/perl -w
use     LWP::Simple;        
use HTML::TokeParser;

my $cpanurl = ' ';
my $rawHTML = get($cpanurl); # attempt to d/l the page to mem
die "LWP::Simple messed up $!" unless ($rawHTML);
my $tp = HTML::TokeParser->new($rawHTML) || die "Can't open: $!";
while (my $token = $tp->get_tag("a"))
        my $url = $token->[1] || "-";
        my $text = $tp->get_text("/a");
        print "$url\t$text\n";


Re: TokeParser does not see javascript links ?

Quoted text here. Click to load it

SO obvious.. the site checks for automatic parsers and simply does not
display links... Load the site in IE and they are there.

So.. sorry for the question. I will post "solution" shortly.

Site Timeline