in reply to Re^2: Win32:: How to tell when Default browser url has loaded
in thread Win32:: How to tell when Default browser url has loaded

Ok...Sorry to disappoint you but this function was written for IE and the object $agent was for a Win32::IEAutomation object.
This is for a webpage which has javascript and if it takes some time to load (for e.g. if you are searching for something on a website and it says "Searching ... or Please Wait while we search")...
In this case the page is not completely loaded, hence you would have to wait for the page to complete.
That's when this code will come into picutre...
I'm not sure but I think You can replace the $agent for any Win32 Module you are using to load the page...
Raghu
  • Comment on Re^3: Win32:: How to tell when Default browser url has loaded

Replies are listed 'Best First'.
Re^4: Win32:: How to tell when Default browser url has loaded
by TAHAIC (Novice) on Dec 13, 2008 at 13:33 UTC
    Firstly...there are no disappointments here...only wisdom shared between members!!...Thank you for your input!!

    Secondly I am using Win32::Process to launch the default browser as follows-

    my $ShellExec = Win32::API->new('shell32', 'ShellExecute', 'NPPPPI', 'N') or die "cannot import ShellExecute: $!\n";

    my $DefaultBrowser = $ShellExec->Call(0, "open", "http://SomeWebSiteURL", "", ".", SW_SHOWNORMAL);

    if ($DefaultBrowser < 33) {

    print STDERR Win32::FormatMessage($DefaultBrowser), "\n";

    exit(1);

    }

    I got this from another posting ...can't remember where...& I am not sure what the 'NPPPPI', 'N' bit is but it seems to work....that is: load the default browser!

    I have the handle $DefaultBrowser to browser object window allowing me to control it!....I should be able to do as you have suggested ..that is: the $agent->ReadyState...

    I will have to spend some time experimenting and trying operation with different default browsers which will take some time....I will post back as soon as I can!

    If anyone else has any more input in the mean time it would be greatly appreciated to all members of the monastery.

    TAHAIC

Re^4: Win32:: How to tell when Default browser url has loaded
by TAHAIC (Novice) on Dec 14, 2008 at 00:41 UTC
    I'm not sure what happened to my last post here.