|
Re: How to get the raw content that is rendered by org.eclipse.swt.browser.Browser [message #454165 is a reply to message #454099] |
Mon, 18 April 2005 17:09 |
Eclipse User |
|
|
|
Originally posted by: doogie03.fastmail.fm
Hi.
I don't think there's a simple way of doing what you want unless you use
a web server. I suggest an embedded web server like Jetty
(http://jetty.mortbay.org/jetty/) - it's easy to setup and use. With an
embedded server (or servlet) you can do all the capturing and
pre-processing of the data you want.
HTH.
~Chris
Alessio Pace wrote:
> Hi, I am approaching to SWT because I saw there is the package
> org.eclipse.swt.browser.Browser which lets me embed a browser (IE or
> Moz) in my client side app. That is fine (great job) but I am wondering
> if and how I can do these 2 things:
>
> 1) assuming the browser component loaded a web page
> (browser.setUrl("www.something.somewhere") ), how can I access the raw
> content of that loaded page? I tought I could have found a method such
> browser.getText(), that is the "dual" method of browser.setText(String
> html), but I don't see it (swt 3.1M6)
>
> 2) I would like to pre-process the pages before they are rendered by the
> browser, modifying the DOM a bit to suit my needs: how can I "hook"
> myself between the fetch-the-page step and the render-the-page step of
> the browser??
>
> thanks,
> Alessio Pace.
>
|
|
|
Re: How to get the raw content that is rendered by org.eclipse.swt.browser.Browser [message #454173 is a reply to message #454099] |
Mon, 18 April 2005 19:25 |
Eclipse User |
|
|
|
Originally posted by: Paul.Helster.gmail.com
Alessio Pace wrote:
> Hi, I am approaching to SWT because I saw there is the package
> org.eclipse.swt.browser.Browser which lets me embed a browser (IE or
> Moz) in my client side app. That is fine (great job) but I am wondering
> if and how I can do these 2 things:
>
> 1) assuming the browser component loaded a web page
> (browser.setUrl("www.something.somewhere") ), how can I access the raw
> content of that loaded page? I tought I could have found a method such
> browser.getText(), that is the "dual" method of browser.setText(String
> html), but I don't see it (swt 3.1M6)
Why not load it directly from the URL ?
URL url = new URL("www.something.somewhere");
in = url.getInputSrtream();
>
> 2) I would like to pre-process the pages before they are rendered by the
> browser, modifying the DOM a bit to suit my needs: how can I "hook"
> myself between the fetch-the-page step and the render-the-page step of
> the browser??
How about calling browser.setText() with the text that you got from the
URL's input stream?
browser.setText(inAsString);
Paul Helster
>
> thanks,
> Alessio Pace.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.12496 seconds