in reply to Links and data extractor script
use strict; use LWP::Simple; use HTML::TokeParser; my ($filename, $results); $results = get('http://[whatever website you want to grab]'); open FH, ">$filename"; # or whatever you want to call your file print FH, $results; close FH; my $stream = HTML::TokeParser->new($filename) || die "Couldn't read HTML file $filename: $!"; while(my $token = $stream->get_token) { # check for your information here # This is from a token parser I wrote to parse web pages. # Hopefully it will get you going # # The S token is a start tag, and the if function returns # the data associated with the tag. # # if ($token->[0] eq "S"){ # print "Token:S 1:$token->[1]\n"; # foreach my $key(keys %{$token->[2]}){ # print "Key: $key Value: #${$token->[2]}{$key}\n"; # } # print "3: @{$token->[3]}\n4: $token->[4]\n\n"; } }
That should at least get you on the road to what you're after.
Good luck!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Links and data extractor script
by sandal (Initiate) on Oct 26, 2005 at 10:13 UTC |