Hey,
I have used the LWP:\:Simple module and saved the source of a website in a file. I am trying to extract all the data between the <head> tags and pass it to a variable to process.
So far I can't seem to extract the data properly. Any suggestions?
my $data = getstore("http://www.google.com/", "website.txt");
unless(is_success($data)){
die "Could not retrive website: $data";
}
open(PAGE, "website.txt") or die "$!";
my @info = <PAGE>;
close(PAGE);
my @meta;
my $i = 0;
my $stuff;
foreach $stuff(@info){
$meta[$i] = ($stuff =~ m/<head(.*?)</head>/);
$i++;
}
$i = 0;
foreach $_ (@meta){
#print $meta[$i];
print $_;
}
Thanks