Browse Source

2.36.0 + README

master
boB Rudis 5 years ago
parent
commit
2d4f164ff0
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 19
      DESCRIPTION
  2. 48
      README.Rmd
  3. 59
      README.md
  4. BIN
      inst/java/commons-text-1.6.jar
  5. BIN
      inst/java/commons-text-1.7.jar
  6. BIN
      inst/java/dec-0.1.2.jar
  7. BIN
      inst/java/htmlunit-2.35.0.jar
  8. BIN
      inst/java/htmlunit-2.36.0.jar
  9. BIN
      inst/java/htmlunit-core-js-2.36.0.jar
  10. BIN
      inst/java/htmlunit-cssparser-1.5.0.jar
  11. BIN
      inst/java/httpclient-4.5.9.jar
  12. BIN
      inst/java/httpmime-4.5.9.jar
  13. BIN
      inst/java/jetty-client-9.4.16.v20190411.jar
  14. BIN
      inst/java/jetty-client-9.4.20.v20190813.jar
  15. BIN
      inst/java/jetty-http-9.4.16.v20190411.jar
  16. BIN
      inst/java/jetty-http-9.4.20.v20190813.jar
  17. BIN
      inst/java/jetty-io-9.4.16.v20190411.jar
  18. BIN
      inst/java/jetty-io-9.4.20.v20190813.jar
  19. BIN
      inst/java/jetty-util-9.4.16.v20190411.jar
  20. BIN
      inst/java/jetty-util-9.4.20.v20190813.jar
  21. BIN
      inst/java/jetty-xml-9.4.16.v20190411.jar
  22. BIN
      inst/java/jetty-xml-9.4.20.v20190813.jar
  23. BIN
      inst/java/neko-htmlunit-2.36.0.jar
  24. BIN
      inst/java/websocket-api-9.4.16.v20190411.jar
  25. BIN
      inst/java/websocket-api-9.4.20.v20190813.jar
  26. BIN
      inst/java/websocket-client-9.4.16.v20190411.jar
  27. BIN
      inst/java/websocket-client-9.4.20.v20190813.jar
  28. BIN
      inst/java/websocket-common-9.4.16.v20190411.jar
  29. BIN
      inst/java/websocket-common-9.4.20.v20190813.jar
  30. 5
      java/htmlunit/Makefile
  31. 2
      java/htmlunit/pom.xml

19
DESCRIPTION

@ -1,17 +1,24 @@
Package: htmlunitjars
Type: Package
Title: Java Archive Wrapper Supporting the 'htmlunit' Package
Version: 2.35.0
Date: 2019-04-27
Version: 2.36.0
Date: 2019-08-24
Authors@R: c(
person("Bob", "Rudis", role = c("aut", "cre"), email = "bob@rud.is")
person("Bob", "Rudis", role = c("aut", "cre"), email = "bob@rud.is"),
person("Mike", "Bowlder", role = "aut", comment = "Original HtmlUnit Java author"),
person("Ahmed", "Ashour", role = "ctb", comment = "HtmlUnit Java contributor"),
person("Brad", "Clarke", role = "ctb", comment = "HtmlUnit Java contributor"),
person("Marc", "Guillemot", role = "ctb", comment = "HtmlUnit Java contributor"),
person("Daniel", "Gredler", role = "ctb", comment = "HtmlUnit Java contributor"),
person("Sudhan", "Moghe", role = "ctb", comment = "HtmlUnit Java contributor"),
person("RBRi", "", role = "ctb", comment = "HtmlUnit Java contributor"),
person("David K.", "Taylor", role = "ctb", comment = "HtmlUnit Java contributor")
)
Maintainer: Bob Rudis <bob@rud.is>
SystemRequirements: Java
Description: Contents of the 'HtmlUnit' & supporting Java archives <http://htmlunit.sourceforge.net/>.
Version number reflects the version number of the included 'JAR' file.
URL: https://github.com/hrbrmstr/htmlunitjars
BugReports: https://github.com/hrbrmstr/htmlunitjars/issues
URL: https://gitlab.com/hrbrmstr/htmlunitjars
BugReports: https://gitlab.com/hrbrmstr/htmlunitjars/issues
License: Apache License 2.0 | file LICENSE
Encoding: UTF-8
Suggests:

48
README.Rmd

@ -1,16 +1,19 @@
---
output: rmarkdown::github_document
output:
rmarkdown::github_document:
df_print: kable
---
```{r include=FALSE}
knitr::opts_chunk$set(message=FALSE, warning=FALSE)
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
```
# htmlunitjars
Java Archive Wrapper Supporting the 'htmlunit' Package
## Description
```{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
```
Contents of the `HtmlUnit` & supporting Java archives <http://htmlunit.sourceforge.net/>. Version number reflects the version number of the included 'JAR' file.
```{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```
>_`HtmlUnit` is a "GUI-Less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser._
>
@ -20,26 +23,21 @@ Contents of the `HtmlUnit` & supporting Java archives <http://htmlunit.sourcefor
>
>_`HtmlUnit` is not a generic unit testing framework. It is specifically a way to simulate a browser._
## What's Inside The Tin
Everything necessary to use the HtmlUnit library directly via `rJava`.
`HtmlUnit` Library JavaDoc: <http://htmlunit.sourceforge.net/apidocs/index.html>
`HtmlUnit` Library JavaDoc: <https://htmlunit.sourceforge.net/apidocs/index.html>
## Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/htmlunitjars")
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```
## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
```{r lib, cache=FALSE}
library(htmlunitjars)
# current verison
@ -51,7 +49,7 @@ packageVersion("htmlunitjars")
`xml2::read_html()` cannot execute javascript so the traditional approach won't work:
```{r}
```{r go1}
library(rvest)
test_url <- "https://hrbrmstr.github.io/htmlunitjars/index.html"
@ -65,13 +63,13 @@ html_table(doc)
We _can_ do this with the classes from `HtmlUnit` proivided by this JAR wrapper package:
```{r}
```{r go2}
library(htmlunitjars)
```
Tell `HtmlUnit` to work like FireFox:
```{r}
```{r go3}
browsers <- J("com.gargoylesoftware.htmlunit.BrowserVersion")
wc <- new(J("com.gargoylesoftware.htmlunit.WebClient"), browsers$CHROME)
@ -79,7 +77,7 @@ wc <- new(J("com.gargoylesoftware.htmlunit.WebClient"), browsers$CHROME)
Tell it to wait for javascript to execute and not throw exceptions on page resource errors:
```{r}
```{r go4}
invisible(wc$waitForBackgroundJavaScriptStartingBefore(.jlong(2000L)))
wc_opts <- wc$getOptions()
@ -89,7 +87,7 @@ wc_opts$setThrowExceptionOnScriptError(FALSE)
Now, acccess the site again and get the table:
```{r}
```{r go5}
pg <- wc$getPage(test_url)
doc <- read_html(pg$asXml())
@ -100,3 +98,9 @@ html_table(doc)
No need for Selenium or Splash!
The ultimate goal is to have an `htmlunit` package that provides a nicer API than needing to know how to work with `rJava` directly.
## htmlunitjars Metrics
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```

59
README.md

@ -1,11 +1,26 @@
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-85.7%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/htmlunitjars.svg?branch=master)](https://travis-ci.org/hrbrmstr/htmlunitjars)
[![Coverage
Status](https://codecov.io/gh/hrbrmstr/htmlunitjars/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/htmlunitjars)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg)
![License](https://img.shields.io/badge/License-Apache-blue.svg)
# htmlunitjars
Java Archive Wrapper Supporting the ‘htmlunit’ Package
## Description
Contents of the `HtmlUnit` & supporting Java archives
Contents of the ‘HtmlUnit’ & supporting Java archives
<http://htmlunit.sourceforge.net/>. Version number reflects the version
number of the included ‘JAR’ file.
@ -30,14 +45,25 @@ number of the included ‘JAR’ file.
Everything necessary to use the HtmlUnit library directly via `rJava`.
`HtmlUnit` Library JavaDoc:
<http://htmlunit.sourceforge.net/apidocs/index.html>
<https://htmlunit.sourceforge.net/apidocs/index.html>
## Installation
``` r
devtools::install_github("hrbrmstr/htmlunitjars")
install.packages("htmlunitjars", repos = "https://cinc.rud.is")
# or
remotes::install_git("https://git.rud.is/hrbrmstr/htmlunitjars.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/htmlunitjars")
# or
remotes::install_gitlab("hrbrmstr/htmlunitjars")
# or
remotes::install_github("hrbrmstr/htmlunitjars")
```
NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.
## Usage
``` r
@ -45,10 +71,9 @@ library(htmlunitjars)
# current verison
packageVersion("htmlunitjars")
## [1] '2.36.0'
```
## [1] '2.34.0'
### Give It A Go
`xml2::read_html()` cannot execute javascript so the traditional
@ -62,10 +87,9 @@ test_url <- "https://hrbrmstr.github.io/htmlunitjars/index.html"
doc <- read_html(test_url)
html_table(doc)
## list()
```
## list()
☹️
We *can* do this with the classes from `HtmlUnit` proivided by this JAR
@ -102,15 +126,24 @@ pg <- wc$getPage(test_url)
doc <- read_html(pg$asXml())
html_table(doc)
## [[1]]
## X1 X2
## 1 One Two
## 2 Three Four
## 3 Five Six
```
## [[1]]
## X1 X2
## 1 One Two
## 2 Three Four
## 3 Five Six
No need for Selenium or Splash\!
The ultimate goal is to have an `htmlunit` package that provides a nicer
API than needing to know how to work with `rJava` directly.
## htmlunitjars Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :---- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: |
| Java | 2 | 0.2 | 28 | 0.30 | 5 | 0.11 | 18 | 0.17 |
| Rmd | 1 | 0.1 | 21 | 0.22 | 35 | 0.76 | 50 | 0.48 |
| Maven | 1 | 0.1 | 17 | 0.18 | 0 | 0.00 | 1 | 0.01 |
| R | 5 | 0.5 | 15 | 0.16 | 1 | 0.02 | 36 | 0.34 |
| make | 1 | 0.1 | 13 | 0.14 | 5 | 0.11 | 0 | 0.00 |

BIN
inst/java/commons-text-1.6.jar

Binary file not shown.

BIN
inst/java/commons-text-1.7.jar

Binary file not shown.

BIN
inst/java/dec-0.1.2.jar

Binary file not shown.

BIN
inst/java/htmlunit-2.35.0.jar

Binary file not shown.

BIN
inst/java/htmlunit-2.36.0.jar

Binary file not shown.

BIN
inst/java/htmlunit-core-js-2.35.0.jar → inst/java/htmlunit-core-js-2.36.0.jar

Binary file not shown.

BIN
inst/java/htmlunit-cssparser-1.4.0.jar → inst/java/htmlunit-cssparser-1.5.0.jar

Binary file not shown.

BIN
inst/java/httpclient-4.5.8.jar → inst/java/httpclient-4.5.9.jar

Binary file not shown.

BIN
inst/java/httpmime-4.5.8.jar → inst/java/httpmime-4.5.9.jar

Binary file not shown.

BIN
inst/java/jetty-client-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/jetty-client-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/jetty-http-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/jetty-http-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/jetty-io-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/jetty-io-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/jetty-util-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/jetty-util-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/jetty-xml-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/jetty-xml-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/neko-htmlunit-2.35.0.jar → inst/java/neko-htmlunit-2.36.0.jar

Binary file not shown.

BIN
inst/java/websocket-api-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/websocket-api-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/websocket-client-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/websocket-client-9.4.20.v20190813.jar

Binary file not shown.

BIN
inst/java/websocket-common-9.4.16.v20190411.jar

Binary file not shown.

BIN
inst/java/websocket-common-9.4.20.v20190813.jar

Binary file not shown.

5
java/htmlunit/Makefile

@ -1,3 +1,4 @@
.PHONY: clean pkg deps run
pkg:
@ -8,8 +9,10 @@ clean:
mvn clean
deps:
rm ../../inst/java/*.jar
rm -f ../../inst/java/*.jar
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
mvn dependency:copy-dependencies -DoutputDirectory=../../inst/java
new:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
mvn archetype:generate -DgroupId=is.rud.htmlunit -DartifactId=htmlunit -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

2
java/htmlunit/pom.xml

@ -12,7 +12,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.35.0</version>
<version>2.36.0</version>
</dependency>
</dependencies>
</project>

Loading…
Cancel
Save