Gossamer Forum
Home : General : Perl Programming :

Good meta-tag extracting perl module?

Quote Reply
Good meta-tag extracting perl module?
Does anyone know of a good meta tag extracting perl module? I looked at http://www.perldoc.com/perl5.6.1/lib/HTTP/Headers.html, but I'm not sure if this actually reads meta-tags, or just writes content headers Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Good meta-tag extracting perl module? In reply to
I've had some success using an HTML parsing module such as HTML::TokeParser.

- wil
Quote Reply
Re: [Andy] Good meta-tag extracting perl module? In reply to
Use LWP::UserAgent.

Code:
use LWP::UserAgent;

my $url = 'http://www.popstars.com';
my $ua = LWP::UserAgent->new( timeout => 20, agent => 'Skully/1.0' );
my $page = $ua->request( HTTP::Request->new( GET => $url ) );
my $title;

if ($page->is_success) {
$title = $page->title;
}
Quote Reply
Re: [Paul] Good meta-tag extracting perl module? In reply to
I think HTML::Tokeparser is a little more flexible in this situation. As in, META tags vary a great deal in the way people write them, and HTML::Tokeparser has been designed with this in mind and specializes in the job of retrieving HTML tags.

- wil