Launching Browser from Java Application: Verify Load Complete?

C

Craig.Lammers

Is there a way to check from a Java Application when a browser has
finished loading the contents of a url? I use the following command to
kick off Internet Explorer from my Java Application:

Process p = Runtime.getRuntime().exec("rundll32
url.dll,FileProtocolHandler " + "http://www.somewebsite.com");

Thanks
 
L

lewmania942

Is there a way to check from a Java Application when a browser has
finished loading the contents of a url?

I can't answer your question.

But for some site there's no such thing as a page "done" loading. Some
sites using (warning buzzword coming) "AJAX technology" keep
transferring data constantly between the browser and the server and
keep refreshing the page (more usually "some part of the page")
constantly.

When would such a site be considered to be done loading?
 
J

Jon Martin Solaas

Is there a way to check from a Java Application when a browser has
finished loading the contents of a url? I use the following command to
kick off Internet Explorer from my Java Application:

Process p = Runtime.getRuntime().exec("rundll32
url.dll,FileProtocolHandler " + "http://www.somewebsite.com");

Thanks


Embed a proxy in your application and monitor the traffic to IE.

Embed the browser itself in your application (need to be java-based,
though ...)

Try to control IE via JNI or some sort of COM-bridge.

Wrap IE in a small VB app or something that will notify your java
program when done loading. Or use a browser that lets you define various
actions, like notifying your application, on certain events, like when
the page is loaded.

Download the content in your application (like a web-spider), store on
disk and point IE there. Or, if you have a caching webproxy installed,
just assume the content will load instantly from cache when IE accesses
it afterwards.

It's already been pointed out that it's not always possible to determine
when a resource has been fully loaded. Done executing code embedded in a
page and done downloading content is also two different things ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,472
Messages
2,571,834
Members
48,802
Latest member
shadowoftheunknown
Top