#!/usr/bin/perl use strict; use lib "/home/jon/perl"; # where BrowserEmulator is use HTML::Parser; use BrowserEmulator; # this gets all the text from the page my @SSNB; # start of ParseLink { package ParseLink; our @ISA = qw(HTML::Parser); # called by parse sub start { my ($this, $tag, $attr) = @_; if ($tag eq "a") { $this->{links}{$attr->{href}} = 1; } } sub get_links { my $this = shift; return keys %{$this->{links}}; } } my $test_url = shift; my $string = &BrowserEmulator::getFullSource($test_url); my $p = ParseLink->new; $p->parse($string); for ($p->get_links) { print "LINK: $_\n"; }