On Apr 29, 8:40 am, [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 = "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 = "cnn.com";
$URL = get("http://www.cnn.com/politics/";);


mkdir "$Domain";


$LinkExtor = HTML::LinkExtor->new(\&links);
$LinkExtor->parse($URL);


sub links
    {
        (undef, %links) = @_;
        if ($links{href} &&
                $links{href} =~ "2008") {
        $url = $links{href};
        $file = $url;
        $file =~ s/http:\/\/www\.//;
        $file =~ s/http:\/\///g;
        $file =~ tr/\//-/;
        mirror ($url, "$Domain/$file.html");
        print "Making $file.html\n";


    }



}


exit;


___END____


Thanks again!


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to