gpt4 book ai didi

r - RSelenium 中的不一致行为

转载 作者:行者123 更新时间:2023-12-04 20:04:44 26 4
gpt4 key购买 nike

在 Linux 上,RSelenium/Selenium似乎行为不正常。我手动启动服务器,它似乎启动正常。有时我可以从我的 R session 连接到它,有时我会收到错误消息。我还不能查明原因:相同的脚本似乎有时有效,有时无效。有任何想法吗?

这是启动服务器的输出:

12:41:25.811 INFO - Launching a standalone server
12:41:26.102 INFO - Java: Sun Microsystems Inc. 11.0-b16
12:41:26.102 INFO - OS: Linux 2.6.32-431.17.1.el6.x86_64 amd64
12:41:26.157 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
12:41:26.492 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
12:41:26.589 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
12:41:26.589 INFO - Version Jetty/5.1.x
12:41:26.590 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
12:41:26.590 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:41:26.590 INFO - Started HttpContext[/,/]
12:41:36.597 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@2993a66f
12:41:36.598 INFO - Started HttpContext[/wd,/wd]
12:41:36.601 INFO - Started SocketListener on 0.0.0.0:4444
12:41:36.601 INFO - Started org.openqa.jetty.jetty.Server@6f507fb2

我在 R session 中收到的错误:
Couldnt connect to host on http://localhost:4444/wd/hub.
Please ensure a Selenium server is running.Error in queryRD(paste0(serverURL, "/session"), "POST", qdata = toJSON(serverOpts))

其他时候,运行完全相同的脚本一切都会成功。这可能与实际执行脚本的计算机节点不同,但是当它无法连接时,我无法确定问题是什么。

最佳答案

library(RCurl)
library(RJSONIO)
library(XML)

# running selenium
system("java -jar selenium-server-standalone-2.44.0.jar")

我遇到了同样的问题并尝试运行上面的代码。终于知道暂时只支持1.7不支持1.8。您可以尝试下载 jre7 和 jdk7。

关于r - RSelenium 中的不一致行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27216284/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com