jBrowserDriver 基于 WebKit 无图形化浏览器开源项目

我要开发同款
匿名用户2016年07月27日
109阅读

技术信息

开源地址
https://github.com/machinepublishers/jbrowserdriver
授权协议
Apache

作品详情

jBrowserDriver是一款采用纯Java编写的无图形化浏览器,基于WebKit,和 Seleium 兼容。

通过Mave安装:

<depedecy>  <groupId>com.machiepublishers</groupId>  <artifactId>jbrowserdriver</artifactId>  <versio>0.16.1</versio></depedecy>

使用示例代码:

import org.opeqa.seleium.WebDriver;import com.machiepublishers.jbrowserdriver.Timezoe;import com.machiepublishers.jbrowserdriver.JBrowserDriver;import com.machiepublishers.jbrowserdriver.Settigs;public class Example {  public static void mai(Strig[] args) {    // You ca optioally pass a Settigs object here,    // costructed usig Settigs.Builder    JBrowserDriver driver = ew JBrowserDriver(Settigs.builder().      timezoe(Timezoe.AMERICA_NEWYORK).build());    // This will block for the page load ad ay    // associated AJAX requests    driver.get("https://example.com");    // You ca get status code ulike other Seleium drivers.    // It blocks for AJAX requests ad page loads after clicks     // ad keyboard evets.    System.out.pritl(driver.getStatusCode());    // Returs the page source i its curret state, icludig    // ay DOM updates that occurred after page load    System.out.pritl(driver.getPageSource());    // Close the browser. Allows this thread to termiate.    driver.quit();  }}

功能介绍

jBrowserDriver 是一款采用纯 Java 编写的无图形化浏览器,基于 WebKit,和 Selenium 兼容。 通过Maven安装:
<dependency>
  <grou...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论