www.cloud86.cn
分类:
2005-05-07 14:48:43
#!/usr/bin/perl
##获取网页联接
##by yzjboy
use LWP::Simple;
use HTML::LinkExtor;
$html = get("");
$link_extor = HTML::LinkExtor->new(&handle_links);
$link_extor->parse($html);
print "Content-type: text/html ";
sub handle_links
{
($tag, %links) = @_;
if ($tag eq 'a') {
foreach $key (keys %links) {
if ($key eq 'href') {
print "FOUND A hypelink to $links{$key}. ";
}
}
}
}