views:

398

answers:

3

Does anyone know of any Java library for programmatic web browsing?

Prowser doesn't cut it because there's no "push the button" method and Watij is limited to Internet Explorer Windows only.

+3  A: 

htmlunit?

http://htmlunit.sourceforge.net/

The above link says:

... HtmlUnit is not a generic unit testing framework. It is specifically a way to simulate a browser for testing purposes...

karim79
HtmlUnit with all of it's dependencies takes 7.6MB. I guess it's not particularly lightweight.
Strudel
Only if it loads all of those. The size of the jars does not dictate how big the resultant executable is (leaving aside the actual VM size)
Brian Agnew
+1 well said: this library is very simple and effective
dfa
+1  A: 

You may be able to find some of what you want in Selenium and especially when using Selenium Server like in this IBM article

Damo
A: 

what do you want to accomplish? what problem are you solving? you might be able to write/find a web scraping java library to get the data that you want.

Jill Renee
What I'm trying to accomplish is to interact with a web site from Java application (to avoid using a web browser).
Strudel
what web site? there might be an equivalent service that you can directly query (like, a yahoo or a google stock service)
Jill Renee