RSelenium >= 1.7.1
의 다운로드 최신 버전과 같은 코드를 실행할 수 있습니다. 다음을 실행하십시오.
library(RSelenium)
rD <- rsDriver() # runs a chrome browser, wait for necessary files to download
remDr <- rD$client
# no need for remDr$open() browser should already be open
rsDriver(browser = "firefox")
을 사용하려는 경우.
자세한 내용은 http://rpubs.com/johndharrison/RSelenium-Basics 부록에서 설명합니다. 그러나 RSelenium을 실행하는 권장 방법은 Docker 컨테이너를 사용하는 것입니다. 이 때문에 같은 수동으로 셀레늄 서버를 실행할 수있는 안티 바이러스 소프트웨어와 같은 관리 권한 또는 다른 변수에 발생할 수있는 문제가있는 경우
: RSelenium와 부두 노동자의 사용 방법은 http://rpubs.com/johndharrison/RSelenium-Docker
문제점에서 찾을 수 있습니다. 이 작업을 수행하는 가장 쉬운 방법은 wdman
패키지를 통해입니다 : 실행되었을 명령 행 호출을 반환 활성화 retcommand
옵션을 wdman
기능 중 하나를 사용
selCommand<-
wdman::selenium(jvmargs = c("-Dwebdriver.chrome.verboseLogging=true"),
retcommand = TRUE)
> cat(selCommand)
C:\PROGRA~3\Oracle\Java\javapath\java.exe -Dwebdriver.chrome.verboseLogging=true -Dwebdriver.chrome.driver="C:\Users\john\AppData\Local\binman\binman_chromedriver\win32\2.27/chromedriver.exe" -Dwebdriver.gecko.driver="C:\Users\john\AppData\Local\binman\binman_geckodriver\win64\0.14.0/geckodriver.exe" -Dphantomjs.binary.path="C:\Users\john\AppData\Local\binman\binman_phantomjs\windows\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe" -jar "C:\Users\john\AppData\Local\binman\binman_seleniumserver\generic\3.0.1/selenium-server-standalone-3.0.1.jar" -port 4567
. 수동으로 다음을 셀레늄 서버를 실행할 수없는 경우
이제 브라우저
remDr <- remoteDriver(port = 4567L, browserName = "chrome")
remDr$open()
을 터미널 지금
C:\Users\john>C:\PROGRA~3\Oracle\Java\javapath\java.exe -Dwebdriver.chrome.verboseLogging=true -Dwebdriver.chrome.driver="C:\Users\john\AppData\Local\binman\binman_chromedriver\win32\2.27/chromedriver.exe" -Dwebdriver.gecko.driver="C:\Users\john\AppData\Local\binman\binman_geckodriver\win64\0.14.0/geckodriver.exe" -Dphantomjs.binary.path="C:\Users\john\AppData\Local\binman\binman_phantomjs\windows\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe" -jar "C:\Users\john\AppData\Local\binman\binman_seleniumserver\generic\3.0.1/selenium-server-standalone-3.0.1.jar" -port 4567
12:15:29.206 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
12:15:29.206 INFO - Launching a standalone Selenium Server
2017-02-08 12:15:29.223:INFO::main: Logging initialized @146ms
12:15:29.265 INFO - Driver class not found: com.opera.core.systems.OperaDriver
12:15:29.265 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
12:15:29.265 INFO - Driver class not found: com.opera.core.systems.OperaDriver
12:15:29.266 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
12:15:29.271 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
2017-02-08 12:15:29.302:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-02-08 12:15:29.317:INFO:osjsh.ContextHandler:main: Started [email protected]{/,null,AVAILABLE}
2017-02-08 12:15:29.332:INFO:osjs.ServerConnector:main: Started [email protected]{HTTP/1.1}{0.0.0.0:4567}
2017-02-08 12:15:29.333:INFO:osjs.Server:main: Started @257ms
12:15:29.334 INFO - Selenium Server is up and running
시도에 고양이의 출력 (selCommand)를 실행하고 실행할 수 있습니다 Selenium 프로젝트 또는 해당 드라이버 프로젝트 (chromedriver/geckodriver/ghostdirver 등)에 대한 귀하의 문제 (관련 로그 파일 포함)를 처리해야합니다.
시도하시는 것에 따라 수백 수천 명의 사람들이 당신이 승/사안을 요구하는 것을 할 수있을 것 같은데도 수백 개이지만 https://github.com/hrbrmstr/splashr을 시험해 볼 수 있습니다. – hrbrmstr
나는 splashr을 사용했고 그것을 추천 할 수도있다 – jdharrison