I am wondering if anyone knows of a way to use java as a virtual
browser. I hope (and imagine) that there are already classes written
to perform this task.
What I want to do is write a java application that will run on a PC
that will send a request to a particular external web site passing
various input as if submitted by an HTML form, and then read the HTML
that is sent back by the site. I will then parse the HTML that is
returned and perform my own, straighforward manipulations on it.
Any ideas as to where to start?
Thanks.
Edward
Roland de Ruiter - 04 Aug 2006 19:44 GMT
> I am wondering if anyone knows of a way to use java as a virtual
> browser. I hope (and imagine) that there are already classes written
[quoted text clipped - 11 lines]
>
> Edward
Sounds you want a HTTP client rather than a full blown browser.
The Apache Commons HTTP Client package allows you to send a HTTP request
(incl. form parameters etc) to some server and receive its response
(which could be a HTML page but also an image or some other document).
See <http://jakarta.apache.org/commons/httpclient/>.

Signature
Regards,
Roland
B Briggs - 04 Aug 2006 20:01 GMT
> I am wondering if anyone knows of a way to use java as a virtual
> browser. I hope (and imagine) that there are already classes written
[quoted text clipped - 11 lines]
>
> Edward
possibly java.net.HttpURLConnection ?
http://java.sun.com/j2se/1.5.0/docs/api/java/net/HttpURLConnection.html

Signature
B Briggs
Edward - 04 Aug 2006 21:02 GMT
> > I am wondering if anyone knows of a way to use java as a virtual
> > browser. I hope (and imagine) that there are already classes written
[quoted text clipped - 17 lines]
> --
> B Briggs
Thanks a lot! I have not tried posting info yet to the URL but the
request is working like a charm.
Edward