ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
343 stars 81 forks source link

Unable to use Chrome Headless in RSelenium #188

Open wjiarao opened 6 years ago

wjiarao commented 6 years ago

Since Firefox version 48, Mozilla requires all add-ons to be signed. Until recently, Firefox support in Selenium was exclusively provided by an add-on. As this add-on is not currently signed, this solution does not work with the latest Firefox releases. As an alternative, Mozilla are working on a WebDriver specification compliant implementation named GeckoDriver. Please note that the specification is not complete, and that Selenium itself does not comply with the specification at this time. This means that features previously available through Selenium will not be available using GeckoDriver.

Currently we would advise against using the latest firefox/geckodriver with selenium untill the w3c webdriver specification is complete. If you wish to use firefox we would advise using an older version via a Docker image. See the RSelenium Docker vignette for more detail:

http://rpubs.com/johndharrison/RSelenium-Docker

If your issue is not with geckodriver/firefox please fill out the template

Operating System

Windows 7 Prof. 64 bit

Selenium Server version (selenium-server-standalone-3.0.1.jar etc.)

selenium-server-standalone-3.9.0.jar

Browser version (firefox 50.1.0, chrome 54.0.2840.100 (64-bit) etc.)

Chrome 69.0.3497.100 64-bit

Other driver version (chromedriver 2.27, geckodriver v0.11.1, iedriver x64_3.0.0, PhantomJS 2.1.1 etc.)

ChromeDvriver 2.42.591088

Expected behaviour

Open Headless mode of Chorme and get data.

Actual behaviour

An error occur

Steps to reproduce the behaviour

system("java -jar \"D:/selenium/selenium-server-standalone-3.9.0.jar\"", wait = FALSE, invisible = FALSE) _session_info()_ Session info ------------------------------------------------------------------------------------------------ setting value
version R version 3.4.1 (2017-06-30)
system x86_64, mingw32
ui RStudio (1.1.383)
language (EN)
collate Chinese (Simplified)_People's Republic of China.936 tz Asia/Taipei
date 2018-10-16

Packages ---------------------------------------------------------------------------------------------------- package version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.4.3)
base
3.4.1 2017-06-30 local
bindr 0.1.1 2018-03-13 CRAN (R 3.4.4)
bindrcpp 0.2.2 2018-03-29 CRAN (R 3.4.4)
binman 0.1.1 2018-07-18 CRAN (R 3.4.4)
bitops
1.0-6 2013-08-17 CRAN (R 3.4.1)
caTools 1.17.1.1 2018-07-20 CRAN (R 3.4.4)
colorspace 1.3-2 2016-12-14 CRAN (R 3.4.3)
compiler 3.4.1 2017-06-30 local
crayon 1.3.4 2017-09-16 CRAN (R 3.4.3)
curl 3.2 2018-03-28 CRAN (R 3.4.4)
data.table 1.11.4 2018-05-27 CRAN (R 3.4.4)
datasets 3.4.1 2017-06-30 local
devtools
1.13.5 2018-02-18 CRAN (R 3.4.3)
digest 0.6.17 2018-09-12 CRAN (R 3.4.4)
dplyr 0.7.6 2018-06-29 CRAN (R 3.4.4)
geosphere 1.5-7 2017-11-05 CRAN (R 3.4.3)
ggmap 2.6.1 2016-01-23 CRAN (R 3.4.4)
ggplot2
3.0.0 2018-07-03 CRAN (R 3.4.4)
glue 1.2.0 2017-10-29 CRAN (R 3.4.3)
graphics 3.4.1 2017-06-30 local
grDevices
3.4.1 2017-06-30 local
grid 3.4.1 2017-06-30 local
gtable 0.2.0 2016-02-26 CRAN (R 3.4.3)
htmltools 0.3.6 2017-04-28 CRAN (R 3.4.3)
httpuv 1.4.5 2018-07-19 CRAN (R 3.4.4)
httr 1.3.1 2017-08-20 CRAN (R 3.4.3)
jpeg 0.1-8 2014-01-23 CRAN (R 3.4.1)
jsonlite 1.5 2017-06-01 CRAN (R 3.4.3)
later 0.7.4 2018-08-31 CRAN (R 3.4.4)
lattice 0.20-35 2017-03-25 CRAN (R 3.4.4)
lazyeval 0.2.1 2017-10-29 CRAN (R 3.4.3)
magrittr 1.5 2014-11-22 CRAN (R 3.4.4)
mapproj 1.2-5 2017-06-08 CRAN (R 3.4.3)
maps 3.2.0 2017-06-08 CRAN (R 3.4.3)
memoise 1.1.0 2017-04-21 CRAN (R 3.4.4)
methods
3.4.1 2017-06-30 local
mime 0.5 2016-07-07 CRAN (R 3.4.1)
munsell 0.5.0 2018-06-12 CRAN (R 3.4.4)
openssl 1.0.2 2018-07-30 CRAN (R 3.4.4)
pillar 1.0.1 2017-11-27 CRAN (R 3.4.3)
pkgconfig 2.0.1 2017-03-21 CRAN (R 3.4.3)
plyr 1.8.4 2016-06-08 CRAN (R 3.4.3)
png 0.1-7 2013-12-03 CRAN (R 3.4.1)
promises 1.0.1 2018-04-13 CRAN (R 3.4.4)
proto 1.0.0 2016-10-29 CRAN (R 3.4.3)
purrr 0.2.4 2017-10-18 CRAN (R 3.4.4)
R6 2.2.2 2017-06-17 CRAN (R 3.4.3)
rappdirs 0.3.1 2016-03-28 CRAN (R 3.4.3)
Rcpp 0.12.16 2018-03-13 CRAN (R 3.4.4)
RCurl 1.95-4.10 2018-01-04 CRAN (R 3.4.3)
reshape2 1.4.3 2017-12-11 CRAN (R 3.4.3)
RgoogleMaps 1.4.2 2018-06-08 CRAN (R 3.4.4)
rjson 0.2.15 2014-11-03 CRAN (R 3.4.1)
RJSONIO
1.3-0 2014-07-28 CRAN (R 3.4.1)
rlang 0.2.0 2018-02-20 CRAN (R 3.4.4)
rlist 0.4.6.1 2016-04-04 CRAN (R 3.4.4)
RSelenium
1.7.4.9000 2018-10-12 Github (ropensci/RSelenium@7509b81) rstudioapi 0.7 2017-09-07 CRAN (R 3.4.3)
rvest 0.3.2 2016-06-17 CRAN (R 3.4.4)
Rwebdriver
0.1 2018-03-06 Github (crubba/Rwebdriver@19a36e9) Rwordseg 0.2-1 2013-12-15 R-Forge (R 3.0.2)
scales 1.0.0 2018-08-09 CRAN (R 3.4.4)
semver 0.2.0 2017-01-06 CRAN (R 3.4.3)
shiny 1.1.0 2018-05-17 CRAN (R 3.4.4)
sp 1.2-6 2018-01-05 CRAN (R 3.4.3)
stats
3.4.1 2017-06-30 local
stringi 1.1.6 2017-11-17 CRAN (R 3.4.2)
stringr 1.2.0 2017-02-18 CRAN (R 3.4.3)
tibble 1.4.1 2017-12-25 CRAN (R 3.4.3)
tidyselect 0.2.4 2018-02-26 CRAN (R 3.4.4)
tools 3.4.1 2017-06-30 local
utils
3.4.1 2017-06-30 local
wdman 0.2.4 2018-07-21 CRAN (R 3.4.4)
withr 2.1.1 2017-12-19 CRAN (R 3.4.3)
XML
3.98-1.16 2018-08-19 CRAN (R 3.4.4)
xml2 * 1.2.0 2018-01-24 CRAN (R 3.4.4)
xtable 1.8-2 2016-02-05 CRAN (R 3.4.3)
yaml 2.1.14 2016-11-12 url

library(wdman) library(binman) library(devtools) library(RSelenium) **eCaps <- list( chromeOptions = list( args = c('--headless'))**) rD <- rsDriver(extraCapabilities = eCaps,version = "3.9.0", check = FALSE) ################ An Error: Error in seleniumver(selplat, version) : version requested doesnt match versions available = ################## I have Changed check to TRUE. ################## rD <- rsDriver(extraCapabilities = eCaps,version = "latest", check = TRUE) Another Error: checking Selenium Server versions: BEGIN: PREDOWNLOAD Error in open.connection(con, "rb") : schannel: failed to receive handshake, SSL/TLS connection failed ############################ rD <- rsDriver(extraCapabilities = eCaps,version = "latest", check = FALSE)_ Error: version is not a character vector ############################ I have try many ways, but still cann't open headless of Chrome, Who can help me? Thanks a lot.