Back around 2001, Mike was working with an eXtreme Programming (XP) team at one of our clients. The team was building a web application and wanted to write automated unit and acceptance tests but at that time, we didn't have the browser automation tools that are available today. The one tool that could be found, only simulated the HTTP protocol and not the interaction of the page.
Check it out at htmlunit.sourceforge.net.
HtmlUnit is released under an Apache style license so that you can freely use it in your project.