Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

java class to act like a browser

Thread view: 
Edward - 04 Aug 2006 19:33 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.