#!/usr/bin/perl -w use strict; use LWP::Simple; use LWP::UserAgent; use HTTP::Cookies; my $counter = 0; my $max_page = 49; # Maximum page number (number of pages displayed per search) my $ua = LWP::UserAgent->new; my $cookie_jar; ## This is a small program that uses a user agent (robot) module to get web pages ## of multiple record links, and store each web page in it's own seperate file. while ($counter <= $max_page) { ## loops through all pages of records #$ua->cookie_jar(HTTP::Cookies->new(file => "$ENV{HOME}/.cookies.txt")); getstore('http://nye.nv.countygovernmentrecords.com/nyecounty/eagleweb/docSearchResults.jsp?page=' . $counter . '&searchId=0', 'test.html' . $counter) or die 'Unable to get page'; $ua->cookie_jar({}); $counter++; print "created test.html $counter\n"; } # end while