Jump to content

HtmlUnit

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Zanetu (talk | contribs) at 20:42, 5 January 2015 (See also: * Selenium WebDriver). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
HtmlUnit
Initial releaseMay 22, 2002 (2002-05-22)
Stable release
2.15 / June 2, 2014 (2014-06-02)
Repository
Written inJava
Operating systemCross-platform (JVM)
Available inEnglish
TypeWeb browser
LicenseApache License 2.0
Websitehtmlunit.sourceforge.net

HtmlUnit is a headless web browser written in Java. It allows high-level manipulation of websites from other Java code, including filling and submitting forms and clicking hyperlinks. It also provides access to the structure and the details within received web pages. HtmlUnit emulates parts of browser behaviour including the lower-level aspects of TCP/IP and HTTP. A sequence such as getPage(url), getLinkWith("Click here"), click() allows a user to navigate through hypertext and obtain web pages that include HTML, JavaScript, Ajax and cookies. This headless browser can deal with HTTPS security, basic http authentication, automatic page redirection and other HTTP headers. It allows Java test code to examine returned pages either as text, an XML DOM, or as collections of forms, tables, and links.[1]

The most common use of HtmlUnit is test automation of web pages, but sometimes it can be used for web scraping, or downloading website content.

Version 2.0 includes many new enhancements such as a W3C DOM implementation, Java 5 features, better XPath support, and improved handling for incorrect HTML, in addition to various JavaScript enhancements, while version 2.1 mainly focuses on tuning some performance issues reported by users.

See also

References

  1. ^ "HtmlUnit Home". Retrieved 23 December 2010.