On Apr 29, 8:40=A0am, nore...@[EMAIL PROTECTED]
(Gunnar Hjalmarsson) wrote:
> hotkitty wrote:
> > I've fixed the issue by reinstalling PERL. However, I am now getting
> > the error message saying: Use of uninitialized value in pattern match
> > (m//) at cctest.pl line 26.
> > (Line 26 is "if ($tag =3D "a href" && "
>
> I already addressed that issue.
>
> http://www.mail-archive.com/beginners%40perl.org/msg93687.html
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Thank you. I have the script up and running, thanks to your input.
Now, I want to switch it up a bit. I ultimately want to go to cnn.com/
politics, follow all links under the "Election Coverage" headline and,
w/in those links, save all the links under the "Don't Miss" sections
that appear in those stories. However, after many hours and trial &
error I've yet to complete the task. I know mechanize can do this
somehow but I've yet to figure out how to put it all together. Here's
the script I have so far, which gets me to only step one:
use LWP::Simple;
require HTML::Parser;
require HTML::LinkExtor;
use warnings;
$Domain =3D "cnn.com";
$URL =3D get("http://www.cnn.com/politics/");
mkdir "$Domain";
$LinkExtor =3D HTML::LinkExtor->new(\&links);
$LinkExtor->parse($URL);
sub links
{
(undef, %links) =3D @[EMAIL PROTECTED]
if ($links{href} &&
$links{href} =3D~ "2008") {
$url =3D $links{href};
$file =3D $url;
$file =3D~ s/http:\/\/www\.//;
$file =3D~ s/http:\/\///g;
$file =3D~ tr/\//-/;
mirror ($url, "$Domain/$file.html");
print "Making $file.html\n";
}
}
exit;
___END____
Thanks again!


|