java class to act like a browser

E

Edward

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
 
R

Roland de Ruiter

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
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/>.
 
B

B Briggs

Edward said:
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

possibly java.net.HttpURLConnection ?
http://java.sun.com/j2se/1.5.0/docs/api/java/net/HttpURLConnection.html
 

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

Staff online

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top