{"id":15151832,"url":"https://github.com/osiris-team/hbrowser","last_synced_at":"2025-04-05T21:07:33.362Z","repository":{"id":44550664,"uuid":"400778650","full_name":"Osiris-Team/HBrowser","owner":"Osiris-Team","description":"Headless/full Java browser with support for downloading files, working with cookies, retrieving HTML and simulating real user input. Possible via Node.js with Puppeteer and/or Playwright. Main focus on ease of use and high-level methods.","archived":false,"fork":false,"pushed_at":"2025-01-16T17:16:59.000Z","size":349,"stargazers_count":121,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-05T21:07:27.545Z","etag":null,"topics":["browser","gson","headless","html","java","javascript","jsoup","nodejs","playwright","puppeteer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Osiris-Team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-28T11:44:35.000Z","updated_at":"2025-01-16T17:16:25.000Z","dependencies_parsed_at":"2024-12-22T17:14:50.368Z","dependency_job_id":"8747dc6f-d2cf-4e7e-bb5e-58df7377e8d3","html_url":"https://github.com/Osiris-Team/HBrowser","commit_stats":{"total_commits":216,"total_committers":3,"mean_commits":72.0,"dds":"0.42592592592592593","last_synced_commit":"1363eff34190c6e762768bcc2b81272a814e022d"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FHBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FHBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FHBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FHBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Osiris-Team","download_url":"https://codeload.github.com/Osiris-Team/HBrowser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399877,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","gson","headless","html","java","javascript","jsoup","nodejs","playwright","puppeteer"],"created_at":"2024-09-26T15:22:25.181Z","updated_at":"2025-04-05T21:07:33.342Z","avatar_url":"https://github.com/Osiris-Team.png","language":"Java","readme":"# HBrowser [![](https://jitpack.io/v/Osiris-Team/HBrowser.svg)](https://jitpack.io/#Osiris-Team/HBrowser)\n\nHeadless/full Java browser with support for downloading files, working with cookies, retrieving HTML and simulating real user input. Possible via Node.js with Puppeteer and/or Playwright. Main focus on ease of use and high-level methods.\nAdd this to your project with [Maven/Gradle/Sbt/Leinigen](https://jitpack.io/#Osiris-Team/HBrowser/LATEST)\n(Java 8 or higher required).\n\n```java\ntry(PlaywrightWindow window = HB.newWin()){\n    window.load(\"https://example.com\");\n   // ...   \n}\n```\nAll examples [here](src/test/java/examples).\nNote that the first run may take a bit because Node.js and its modules get installed into your current working dir under `./headless-browser`.\n\n### Important\nOn newer playwright versions you might need to install additional dependencies manually on your machine, this requires root permissions.\nNormally those dependencies are pre-installed though. You will notice if there is an exception. For details print debug to System.out.\n```shell\ncd ./headless-browser/node-js/node-js-working-dir \u0026\u0026 ./headless-browser/node-js/node-js-installation/bin/npx playwright install-deps\n```\n\n### Features\n - **High-Level methods for...**\n   - downloading files.\n   - working with cookies.\n   - retrieving HTML.\n   - simulating real user input. \n - **Integrated evasions for headless detection: `HB.newWinBuilder().headless(true).makeUndetectable(true)...`**\n - **Easy access to Node.js from within Java: `new NodeContext().executeJavaScript(\"console.log('Hello!');\");`**\n - **HTML handling via Jsoup and JSON with Gson.**\n\n### \n\n\u003cdetails\u003e\n\u003csummary\u003eHow good are the evasions?\u003c/summary\u003e\n\n![image](https://github.com/Osiris-Team/HBrowser/assets/59899645/06009620-52f0-496d-9d4b-f06fe0d4bec4)\n\n\n```java\ntry (PlaywrightWindow w = HB.newWinBuilder()\n     .headless(true).makeUndetectable(true).buildPlaywrightWindow())\n{\n    w.load(\"https://infosimples.github.io/detect-headless/\");\n    w.makeScreenshot(new File(\"screenshot.png\"), true);\n} \ncatch (Exception e) {e.printStackTrace();}\n ```\nLast checked 18.06.2024.\n\u003c/details\u003e\n\n### Drivers\nPlaywright is the default and recommended browser driver to use, since it supports downloads\nand more of its features were ported to Java.\nCheckout [JG-Browser](https://github.com/Osiris-Team/JG-Browser) for a browser completely written in Java.\n\n| Name |    JS-Engine    | Downloads |\n| :-----: |:---------------:| :-----:\n| [Playwright](https://github.com/microsoft/playwright)|   Node.js/V8    | Yes | No |\n| [Puppeteer](https://github.com/puppeteer/puppeteer) |   Node.js/V8    | No | No |\n\nYou can find their versions in [this class](https://github.com/Osiris-Team/HBrowser/blob/main/src/main/java/com/osiris/headlessbrowser/Versions.java),\nwhich also allows you to set custom versions.\n(JS = JavaScript; Downloads = If the browser is able to download files other than html/xml/pdf;)\n\n### Contribute/Build\n\n#### Beginners\n\nIf you have never contributed before, we recommend\nthis [Beginners Article](https://www.jetbrains.com/help/idea/contribute-to-projects.html). If you are planning to make\nbig changes, create an issue first, where you explain what you want to do. Thank you in advance for every contribution!\nIf you don't know how to import a GitHub project, check out this\nguide: [IntelliJ IDEA Cloning Guide](https://blog.jetbrains.com/idea/2020/10/clone-a-project-from-github/)\n\n#### Build-Details\n\n- Written in [Java](https://java.com/),\n  with [JDK 8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html), inside\n  of [IntelliJ IDEA](https://www.jetbrains.com/idea/)\n- Built with [Maven](https://maven.apache.org/), profiles: clean package\n\n### Libraries\n\n| Name/Link | Usage | License |\n| :-----: | :-----: | :-----: |\n| [Playwright](https://github.com/microsoft/playwright) | Emulates different types of browsers | [License](https://github.com/microsoft/playwright/blob/master/LICENSE) |\n| [Puppeteer](https://github.com/puppeteer/puppeteer) | Emulates different types of browsers  | [License](https://github.com/puppeteer/puppeteer/blob/main/LICENSE) |\n| [Node.js](https://github.com/nodejs/node) | Enables executing JavaScript code | [License](https://github.com/nodejs/node/blob/master/LICENSE) |\n| [Jsoup](https://github.com/jhy/jsoup)      | Used to load pages and modify their HTML code      |   [License](https://github.com/jhy/jsoup/blob/master/LICENSE) |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosiris-team%2Fhbrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosiris-team%2Fhbrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosiris-team%2Fhbrowser/lists"}