use strict; use Win32::OLE qw(EVENTS); my $URL = "http://REQUIRED WEB PAGE"; my $IE; my $timeout; displaywebpage(); sub Event { my ($Obj,$Event,@Args) = @_; my $IEObject; print "Here is the Event: $Event\n"; if ($Event eq "DocumentComplete") { $IEObject = shift @Args; print "URL: " . $IEObject->Document->URL . "\n"; print "Now quit IE\n"; $IE->Quit; } elsif ($Event eq "OnQuit") { Win32::OLE->QuitMessageLoop(); } } sub displaywebpage { $IE = Win32::OLE->new("InternetExplorer.Application") || die "Could not start Internet Explorer.Application\n"; $IE->{visible} = 1; Win32::OLE->WithEvents( $IE, \&Event, 'DWebBrowserEvents2' ); $IE->Navigate($URL); Win32::OLE->MessageLoop(); $timeout = 30*60; # n seconds print "Wait for $timeout seconds\n"; $timeout -= sleep $timeout while $timeout > 0; print "Now start again\n"; displaywebpage(); }