That's the first time I've heard of HtmlUnit. For web stuff with Java I simply open a socket, open a BufferedReader for reading, PrintWriter for sending stuff. Just send an HTTP request and listen for a response.
As for automation and login, it will require for you to figure out a way to get socket usage down first, then learn the basics of HTTP so that you can send GET requests, POST request and also receive the information the server sends. Sometimes, some really nice people include APIs in their web designs which make it SO much easier to automate requests and interaction with the web server because they are usually sent in a different format than HTML (typically JSON) which is better formatted for reading
Now Flash really is a problem, there is probably nothing you or I can do about that because Flash is a completely different medium and doesn't exactly support automated interfacing as far as I know.
For a really good reference on Sockets and how to use them, go to
http://docs.oracle.com/javase/tutorial/ ... index.html After reading and performing all of the exercises in the lesson, it's a very easy step to do web programming with it. If you need help with it, post back here or go on IRC #coffeesh0p, we're always willing to help you there.
<3 WallShadow