gube has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, Is there any option to refresh the iexplore through win32::OLE qw(EVENTS) for each 5 minutes (or) like timer control available in PERL TK. please provide some sample codes.
Thanks in advance.

Regards,
Gubendran.L

Replies are listed 'Best First'.
Re: How to Refresh iexplore
by jdporter (Paladin) on Feb 10, 2005 at 03:01 UTC
    Assuming you're trying to refresh an IE which has already been launched, you'll have to go to some trouble to locate that object. My approach, below, is to get the list of all open Explorer windows (which, unfortunately, includes both regular "Windows Explorer" windows and IE windows), and sift through them based on various attributes, such as the app's full name and current URL.
    use Win32::OLE; my $sh = new Win32::OLE 'Shell.Application' or die "new Shell.App"; my $wins = $sh->Windows; for ( in $wins ) { if ( Win32::OLE->QueryObjectType($_) eq 'IWebBrowser2' ) { if ( $_->FullName =~ /IEXPLORE.EXE/ and $_->LocationName =~ /Welcome to my world/ # page's title # $_->LocationURL =~ /perlmonks.org.*jdporter/ # page's UR +L ) { $_->Refresh; } } }
Re: How to Refresh iexplore
by johnnywang (Priest) on Feb 10, 2005 at 02:19 UTC
    use strict; use Win32::OLE; my $ie = Win32::OLE->new("InternetExplorer.Application") or die "Can't + start IE\n"; $ie->{visible} = 1; $ie->navigate("http://www.perlmonks.org"); while(1){ $ie->Refresh(); sleep 5*60; }