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

Hi to all,

I am not sure if this is the right forum to post this query. But please help if possible..

I am working on a perl module called Win32::IE::Mechanize which opens up Internet Explorer using OLE automation concept and gets the html content of any url. It works fine when used in Windows platform directly. But if I try to run the program in Windows from Unix platform using SSH to communicate to the Windows machine, it is not working.

Can you please help me in knowing what is the problem and how to fix it. Or please suggest me where to post this query if this is not the right forum..

Thanks a lot in advance..

update :

The Win32::IE::Mechanize module is such that it prints 'Cannot create an InternetExplorer.Application' if it is not able to open up Internet Explorer successfully. But this error message is not displayed. So I guess it is able to open IE but not able to communicate properly with it. Appending this update, perhaps it may give a better picture..

Replies are listed 'Best First'.
Re: Win32::IE::Mechanize from unix????
by Corion (Patriarch) on Apr 15, 2008 at 07:48 UTC

    This is most likely a permissions/account problem. What user does your (Windows) ssh server run as?

    Does this user have a desktop and is it logged in? Without a desktop (on which to launch and display IE), nothing will work.

    Does this user have permissions to launch IE? You can check that by logging in via ssh and manually launching iexplore.exe.

    Does this user have permissions to use OLE objects? This is an integral point of Windows, but I've seen some systems (mis)configured to disallow even DCOM and local COM.

    More error messages and the actual code might also help us to help you, but if the script works when used directly but doesn't when launched through ssh, all fingers point to ssh as the culprit.

      Thanks for the reply. I ll check those things out.
      The following is the code I am trying
      use Win32::IE::Mechanize; use Time::HiRes; my $ie = Win32::IE::Mechanize->new( visible => 1 ); $url = 'http://www.yahoo.com/'; $ie->get( $url ); sleep(5); print $ie->content; $ie->close;
      There is no error message as such. The output is the content of the standard "This Page cannot be Displayed" screen.
      I looked into the questions asked by me and found this

      >Does this user have a desktop and is it logged in? Without a desktop (on which to launch and display IE), nothing will work.

      Nope, the user will connect to SSH server running on Windows (WinSSHD) from a unix machine using open ssh client. He will have access to command prompt of the SSH server running on Windows. Also in this scenario, user will not be able to get to desktop as ssh access is completely a CLI.

      >Does this user have permissions to launch IE? You can check that by logging in via ssh and manually launching iexplore.exe.

      Yes, user has rights and could launch iexplore.exe after doing ssh to windows machine.

      >Does this user have permissions to use OLE objects? This is an integral point of Windows, but I've seen some systems (mis)configured to disallow even DCOM and local COM.

      yes as same scripts works fine when we run it from same Windows machine which is running SSH server.
Re: Win32::IE::Mechanize from unix????
by moritz (Cardinal) on Apr 15, 2008 at 07:38 UTC
    What's the error message? (the one returned from Win32::OLE->LastError()).

    Does your program run on the windows machine, being remote controlled from a unix host? (I think yes, but I'm not 100% sure if I understood that right).

      It runs on the windows machine. I am able to get the complete output
      There is no error message. The output is the contents of the 'This Page Cannot be displayed' screen irrespective of what url I try to load