HBrowser
Another headless browser for Java with Puppeteer and Playwright implemented. Add this to your project with Maven/Gradle/Sbt/Leinigen (Java 8 or higher required).
HBrowser hBrowser = new HBrowser();
try(PlaywrightWindow window = hBrowser.openWindow()){
window.load("https://example.com");
// ...
}
All examples here. Note that the first run may take a bit because Node.js and its modules get installed into your current working dir under ./headless-browser
.
Features
- High-Level methods for downloading files, working with cookies, retrieving HTML and simulating real user input.
- Easy access to Node.js from within Java.
- HTML handling via Jsoup and JSON with Gson.
Drivers
Playwright is the default and recommended browser driver to use, since it supports downloads and more of its features were ported to Java. Checkout JG-Browser for a browser completely written in Java.
Name | Version | JS-Engine | Downloads |
---|---|---|---|
Playwright | Latest | Node.js/V8 | Yes |
Puppeteer | Latest | Node.js/V8 | No |
(JS = JavaScript; Downloads = If the browser is able to download files other than html/xml/pdf;)
Contribute/Build
Libraries
Name/Link | Usage | License |
---|---|---|
Playwright | Emulates different types of browsers | License |
Puppeteer | Emulates different types of browsers | License |
Node.js | Enables executing JavaScript code | License |
Jsoup | Used to load pages and modify their HTML code | License |