in reply to Extracting href's

Welcome to the Monastery!

HTML::TokeParser scares you? no problem, Ovid made HTML::TokeParser::Simple that will make your life easier :)

Here it is a little example:

use HTML::TokeParser::Simple; use strict; use vars qw( $parser $attributes ); $parser = HTML::TokeParser::Simple->new($ARGV[0]); while ( my $token = $parser->get_token ) { next unless ($token->is_start_tag('a')); $attributes $token->return_attr; if(exists $attributes->{href}) { print $attributes->{href}, "\n"; } }

We also have some nice Tutorials to get you started and many book reviewed at Book Reviews.

Ciao, Valerio

Replies are listed 'Best First'.
Re: Re: Extracting href's
by Scott_J (Initiate) on Jan 10, 2003 at 13:47 UTC
    Thanks everyone. I'll have a try at this, this afternoon. :)