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")
を使用する場合は、Firefoxを使用します。
詳細はhttp://rpubs.com/johndharrison/RSelenium-Basics付録に記載されています。しかし、RSeleniumを実行するための推奨される方法はDockerコンテナによるものです。あなたはこのような手動Seleniumサーバーを実行することができますアンチウイルスソフトウェアとして、管理者権限または他の変数に発生する可能性のある問題を持っている場合は
: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
走っされていたであろう コマンドライン呼び出しを返します。
今、あなたはあなたが手動で、あなたのセレンServerを実行できない場合は今すぐ
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など)へのあなたの問題(関連するログファイルを含む)に対処する必要があります
あなたがしようとしていること何百もの人々があなたがw/oの問題を尋ねていることをすることができるように思われる場合は、何百人もの人がhttps://github.com/hrbrmstr/splashrを試してみてください。 – hrbrmstr
私はsplashrを使いましたが、それもお勧めします – jdharrison