簡體   English   中英

RSelenium和Docker快速入門終端-無法連接到遠程服務器

[英]RSelenium and Docker Quick Start Terminal - cannot connect to remote server

我正在嘗試Rselenium的初期工作。 我遵循了這篇文章中的指南:“ 無法執行rsDriver(連接被拒絕)

library(RSelenium)
#Let's Start
shell('docker pull selenium/standalone-firefox')
shell('docker run -d -p 4445:4444 selenium/standalone-firefox')
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4445L, browserName = "firefox")
remDr$open()
remDr$navigate("http://www.google.com")
remDr$getTitle()

但控制台打印:

> library(RSelenium)
> #Let's Start
> shell('docker pull selenium/standalone-firefox')
Using default tag: latest
Warning: failed to get default registry endpoint from daemon (error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/info: open //./pipe/docker_engine: In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.). Using system default: https://index.docker.io/v1/
error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/images/create?fromImage=selenium%2Fstandalone-firefox&tag=latest: open //./pipe/docker_engine: Nie można odnaleźć określonego pliku. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
Warning message:
In shell("docker pull selenium/standalone-firefox") :
  wykonywanie 'docker pull selenium/standalone-firefox' error code 1
> shell('docker run -d -p 4445:4444 selenium/standalone-firefox')
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/containers/create: open //./pipe/docker_engine: In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
See 'docker run --help'.
Warning message:
In shell("docker run -d -p 4445:4444 selenium/standalone-firefox") :
  wykonywanie 'docker run -d -p 4445:4444 selenium/standalone-firefox' error code: 125
> remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4445L, browserName = "firefox")
> remDr$open()
[1] "Connecting to remote server"
Error in checkError(res) : 
  Undefined error in httr call. httr output: Failed to connect to localhost port 4445: Connection refused
> remDr$navigate("http://www.google.com")
Error in checkError(res) : 
  Undefined error in httr call. httr output: length(url) == 1 is not TRUE
> remDr$getTitle()
Error in checkError(res) : 
  Undefined error in httr call. httr output: length(url) == 1 is not TRUE

我可以請求幫助嗎?

在cmd @FOR /f "tokens=*" %i IN ('docker-machine.exe env --shell cmd') DO @%i運行此命令@FOR /f "tokens=*" %i IN ('docker-machine.exe env --shell cmd') DO @%i ,然后嘗試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM