Movatterモバイル変換


[0]ホーム

URL:


wdman

R-CMD-checkcodecov

Introduction

wdman (Webdriver Manager) is an R package that allowsthe user to manage the downloading/running of third party binariesrelating to the webdriver/selenium projects. The package was inspired bya similar node packagewebdriver-manager.

The checking/downloading of binaries is handled by thebinmanpackage, and the running of the binaries as processes is handled by thesubprocesspackage.

Thewdman package currently manages the followingbinaries:

Associated with the above are five functions to download/manage thebinaries:

Installation

You can installwdman from GitHub with:

# install.packages("remotes")remotes::install_github("ropensci/wdman")

The package can also be installed from CRAN:

install.packages("wdman")

Example

As an example, we show how one would run the Selenium standalonebinary as a process:

Running the Selenium binary

The binary takes a port argument which defaults toport = 4567L. There are a number of optional arguments touse a particular version of the binaries related to browsers seleniummay control. By default, theselenium function will look touse the latest version of each.

selServ<-selenium(verbose =FALSE)selServ$process## PROCESS 'file50e6163b37b8.sh', running, pid 21289.

Theselenium function returns a list of functions and ahandle representing the running process.

The returnedoutput,error andlog functions give access to the stdout/stderr pipes andthe cumulative stdout/stderr messages respectively.

selServ$log()## $stderr## [1] "13:25:51.744 INFO [GridLauncherV3.parse] - Selenium server version: 4.0.0-alpha-2, revision: f148142cf8"## [2] "13:25:52.174 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4567"## [3] "13:25:54.018 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet"## [4] "13:25:54.539 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4567"## $stdout## character(0)

Thestop function sends a signal that terminates theprocess:

selServ$stop()## TRUE

Available browsers

By default, theselenium function includes paths tochromedriver/geckodriver/phantomjs so that the Chrome/Firefox andPhantomJS browsers are available respectively. All versions (chromever,geckover etc) are given as"latest". If the user passes avalue ofNULL for any driver, it will be excluded.

On Windows operating systems, the option to included the InternetExplorer driver is also given. This is set toiedrver = NULL so not ran by default. Set it toiedrver = "latest" or a specific version string to includeit on your Windows.

Further details

For further details, please seethe packagevignette.



[8]ページ先頭

©2009-2025 Movatter.jp