全部博文(279)
分类:
2008-01-22 14:33:05
#!/usr/bin/perl
use LWP::Simple;
use HTML::Parser;
my $url = shift || "";
my $content = LWP::Simple::get($url) or die("unknown url\n");
my $parser = HTML::Parser->;new(
start_h =>; [\&start, "tagname, attr"],
);
$parser->;parse($content);
exit 0;
sub start
{
my ($tag, $attr, $dtext, $origtext) = @_;
if($tag =~ /^img$/)
{
if (defined $attr->;{'src'} )
{
print "$attr->;{'src'}\n";
}
}
}