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

I want read the content of an active internet.explorer window on windows.

So, I don't want to start a new browser window, but get the content which the user has on his screen. Tried several settings but canīt get the content.

I tried lines like this but wonīt work
use Win32::OLE; my $IEbrowser = Win32::OLE->new('InternetExplorer.Application'); $IEbrowser->{visible} = 1; print "$IEDocument";
Any help appreciated
Perry
Some little lines

2003-05-02 edit ybiC: <code> tags

Replies are listed 'Best First'.
Re: Reading the active internet.explorer
by beachbum (Beadle) on May 03, 2003 at 06:33 UTC

    I think what you're looking for is "GetActiveObject".

    I played around with this briefly several months ago, but a never had a use for it, so I never pursued it. Most of my research success came from http://msdn.microsoft.com and the OLE-Browser from ActiveState.

    here's a bit of code that reads the url of all open browsers before closing them:

    use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Internet Controls'; my $app; my $count = 0; while(defined ($app = Win32::OLE->GetActiveObject('InternetExplorer.Ap +plication'))){ $count++; $app->{'Visible'} = 1; my $result = $app->{'LocationURL'}; print $result . "\n"; $app->Quit; undef $app; sleep 1; } print "Total windows: $count\n"; # $app->{'TheaterMode'} = 1; # $app->{'FullScreen'} = 1; # $app->Quit;

    2003-05-03 edit ybiC: <code> tags

      This unfortunatly still not what I want. It should just print out the whole content which a user has activ in a windows on his screen, not activated by a perl script. So a user is just browsing his interne.explorer and than on a moment when he start a perl scipt it will read and afcourse extract the content which the person has active on his window. I canīt find the trigger...any help appreciated. Perry