in reply to Ending a loop of content of LWP's get-function
#!/usr/bin/perl -w # Get urls from result page use warnings; use strict; use LWP::Simple; my ($html, $url, @urls); my $count = 0; $html = get("http://localhost:8080/html.htm") or die "Couldn't fetch p +age."; while($html =~ m{<(a class=\"smallV110\" href=\"/)(.*?)\">}g) { my $new_url = $2; print "$new_url\n"; $count++; print "$count\n"; push @urls, $new_url; }
|
|---|