Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use LWP::Simple; use HTML::TokeParser; use HTML::Entities; my @newspages = qw( http://osis.nima.mil http://osis.nima.mil/myhot.html http://osis.nima.mil/myoffices.html http://osis.nima.mil/mytraining.html http://osis.nima.mil/mygeospatial.html ); for (@newspages) { my $html = $_; my ($junk,$short) = split(/\./,$html); # get domain name my $body .= "<td valign=top>$short<br>"; my $get = get("$html"); my $p = HTML::TokeParser->new(\$get); while (my $token = $p->get_tag("a")) { my $url = $token->[1]{href} || "-"; my $text = $p->get_trimmed_text("/a"); unless ($url =~ /^mailto|^javascript/){ # don't grab javascrpt or mai +lto's $body .= "<a href=\"$url\" target=\"new\">$text</a><br>\n"; } } $body .= "</td>" } my $body .= "</tr></table>"; open(OUT,">news.txt"); # send to an html file print OUT "$body";
Use of uninitialized value in substr at C:/Perl/site/lib/HTML/PullPars +er.pm line 82. Use of uninitialized value in length at C:/Perl/site/lib/HTML/PullPars +er.pm line 85. Use of uninitialized value in substr at C:/Perl/site/lib/HTML/PullPars +er.pm line 82. Use of uninitialized value in length at C:/Perl/site/lib/HTML/PullPars +er.pm line 85.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: web link errors
by Stegalex (Chaplain) on Mar 12, 2002 at 14:05 UTC | |
|
Re: web link errors
by silent11 (Vicar) on Mar 12, 2002 at 13:59 UTC | |
by Anonymous Monk on Mar 12, 2002 at 14:23 UTC |