cdp4j

cdp4j - Chrome DevTools Protocol for Java

License

License

cdp4j Commercial License
GroupId

GroupId

io.webfolder
ArtifactId

ArtifactId

cdp4j
Last Version

Last Version

3.0.15
Release Date

Release Date

Type

Type

jar
Description

Description

cdp4j
cdp4j - Chrome DevTools Protocol for Java
Project URL

Project URL

https://webfolder.io
Project Organization

Project Organization

WebFolder OÜ
Source Code Management

Source Code Management

https://github.com/webfolderio/cdp4j.git

Download cdp4j

How to add to project

<!-- https://jarcasting.com/artifacts/io.webfolder/cdp4j/ -->
<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>cdp4j</artifactId>
    <version>3.0.15</version>
</dependency>
// https://jarcasting.com/artifacts/io.webfolder/cdp4j/
implementation 'io.webfolder:cdp4j:3.0.15'
// https://jarcasting.com/artifacts/io.webfolder/cdp4j/
implementation ("io.webfolder:cdp4j:3.0.15")
'io.webfolder:cdp4j:jar:3.0.15'
<dependency org="io.webfolder" name="cdp4j" rev="3.0.15">
  <artifact name="cdp4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.webfolder', module='cdp4j', version='3.0.15')
)
libraryDependencies += "io.webfolder" % "cdp4j" % "3.0.15"
[io.webfolder/cdp4j "3.0.15"]

Dependencies

provided (6)

Group / Artifact Type Version
org.jvnet.winp : winp jar 1.28
org.slf4j : slf4j-api jar 1.7.25
com.jcabi : jcabi-ssh jar 1.6
log4j : log4j jar 1.2.17
org.apache.commons : commons-compress jar 1.18
com.github.markusbernhardt : proxy-vole jar 1.0.5

test (4)

Group / Artifact Type Version
com.squareup : javapoet jar 1.9.0
ch.qos.logback : logback-classic jar 1.2.3
junit : junit jar 4.12
uk.com.robust-it : cloning jar 1.9.5

Project Modules

There are no modules declared in this project.

Important Announcement: New versions is not released to GitHub and not publicly available. Please contact us to download new cdp4j versions.

cdp4j - Browser automation libray for Java

cdp4j is Java library with a clear and concise API to automate Chrome/Chromium based browser. It use Google Chrome DevTools Protocol to automate Chrome/Chromium based browsers.

What can you do with cdp4j?

  • Automatically fill-out forms. You can easily download and upload of text, images, handle PDF files, or take screenshots.
  • Import or export data to and from web applications.
  • Extract Any Kind of Data from the Web.
  • Automate Web Upload/Download.

Main Features

  • Supports full capabilities of the Chrome DevTools Protocol (tip-of-tree)
  • PDF printer
  • Evaluate JavaScript
  • Invoke JavaScript function
  • Invoke Java function from Browser (JavaScript)
  • Supports native CSS selector engine
  • Supports XPath queries
  • Incognito Browsing (private tab)
  • Full page screen capture
  • Support parallel running
  • Auto-Wait for DOM change completion
  • Trigger Mouse events (click etc...)
  • Send keys (text, tab, enter etc...)
  • Redirect log entries (javascript, network, storage etc...) from browser to slf4j, log4j or console logger.
  • Intercept Network traffic (request & response)
  • Upload file programmatically without third party solutions (does not requires AWT Robot etc...)
  • get & set Element properties
  • Supports Headless Chrome/Chromium
  • Navigate back, forward, stop, reload
  • clear cache, clear cookies, list cookies
  • set & get values of form elements
  • Supports event handling
  • Supports all well known Java WebSocket libraries.

Supported Java Versions

Oracle/OpenJDK, GraalVM Native Image.

Both the JRE and the JDK are suitable for use with this library.

Note: We only support LTS versions (8 & 11).

Stability

This library is suitable for use in production systems. Our library is used by many well known enterprise customers.

Download

cdp4j-4.2.2.jar

Maven Integration

Install artifacts for Windows:

mvn deploy:deploy-file -DgroupId=io.webfolder -DartifactId=cdp4j -Dversion=4.2.2 -Dfile=cdp4j-4.2.2.jar -Dpackaging=jar -Durl=file://%USERPROFILE%\.m2\repository

Install artifacts for Nix:

mvn deploy:deploy-file -DgroupId=io.webfolder -DartifactId=cdp4j -Dversion=4.2.2 -Dfile=cdp4j-java-4.2.2.jar -Dpackaging=jar -Durl=file://$HOME/.m2/repository

Supported Platforms

cdp4j has been tested under Windows 10 and Ubuntu, but should work on any platform where a Java 8+/Graal VM/Substrate VM & Chrome/Chromium/Microsoft Edge available.

Note: Although we do not execute test suites on Mac, many customers run cdp4j without any problem. Please do not hesitate to report bugs related with Mac.

Release Notes

CHANGELOG.md

Headless Mode

cdp4j can be run in "headless" mode using with Options.headless(boolean) option.

Install Chrome on Debian/Ubuntu

# https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line
sudo apt-get install libxss1 libappindicator1 libappindicator3-1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next line
sudo apt-get install -f

Install Chrome on RHEL/CentOS/Fedora

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install google-chrome-stable_current_*.rpm

JavaDoc

cdp4j api

Logging

slf4j 1.x, log4j 1.x and custom Console logger is supported.

Note: Please let us know if your preferred logging library is not listed.

WebSocket Protocol

DevTools Protocol uses WebSocket protocol to automate Chromium based browser. We supports the following Java WebSocket libraries.

  • Jre WebSocket Library (requires Java 11+).
  • Jetty
  • Undertow
  • Vertx
  • Tyrus
  • TooTallNateWebSocket
  • Tomcat
  • Netty
  • NvWebSocket

Note: Please let us know if your preferred WebSocket library is not listed.

Examples

We provide many examples to show how to use cdp4j library. It's highly recommended to run these examples before starting to use cdp4j.

Design Principles

  • Avoid external dependencies as much as possible.
  • Support only Chrome/Chromium based browsers.
  • Supports full capabilities of the Chrome DevTools Protocol.
  • Keep the API simple.
  • Support GraalVM Native Image.

How it is tested

cdp4j is regularly built and tested on Windows 10 and Ubuntu.

Support & Bug Report

Please report your bugs and new features by e-mail ([email protected]). github issues is only used by cdp4j developers.

License

cdp4j is a proprietary software which means that you or your company needs commercial license to use cdp4j.

Trial

You are free to use this library for only development purpose. It's not require to buy commercial for trial usage. Production systems requires commercial license without any exception.

Versions

Version
3.0.15
3.0.14
3.0.13
3.0.12
3.0.11
3.0.10
3.0.9
3.0.8
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
1.2.0
1.1.0
1.0.3
1.0.2