Good luck and i hope this can point you in the right direction.use strict; use LWP::UserAgent; ##### Declaring my local variables, initializing useragent and open lo +g file.####### my($url, @urls); my $ua = LWP::UserAgent->new(); open(OUT,">results.log") or die "Couldn't open results.log"; print OUT "\n"; ##### Stuffing the urls into an array ##################### @urls = ("http://www.blahblah.com, http://www.blah.com, ); #### Looping through the urls, grabbing the html and stuffing it into +an array. #### foreach $url(@urls){ my $request = new HTTP::Request('GET',$url); $ua->timeout(10); my $response = $ua->request($request); my $responsecode = $response->code(); print "GET failed\n" if $responsecode != 200; my @ARRAY_OF_LINES = (split "\n", $ua->request($request)->as_string); my $row; #### Parsing the html with a regex to find the the updated times ##### +## foreach $row (@ARRAY_OF_LINES) { chomp($row); if ($row =~ /.*?Updated\s*:\s*(\w+\s*-\s*\d{1,2}\s+\d{1,2}:\d{1,2 +}:\d{1,2}\s+PST)/i) { print OUT "Last Updated: $1\n\n"; last; }elsif ($row =~ /.*?Updated\s*:\s*(\w+\s*\w+\s*\d{1,2}\s+\d{1, +2}:\d{1,2}:\d{1,2}\s+PST\s*\d*)/i) { print OUT "Last Updated: $1\n\n"; last; } } } close(OUT);
In reply to Re: How do I get information from a vendors web page.
by RayRay459
in thread How do I get information from a vendors web page.
by Marza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |