在Windows 7上使用带有RSelenium的phantomjs
发布时间:2020-12-14 02:50:50 所属栏目:Windows 来源:网络整理
导读:我正在尝试将PhantomJS与RSelenium一起使用并且似乎遇到了麻烦: require(RSelenium)RSelenium::startServer()remDr - remoteDriver(browserName = "phantomjs",extraCapabilities = list(phantomjs.binary.path = "C:/Users/home/Desktop/phantomjs-1.9.8-w
我正在尝试将PhantomJS与RSelenium一起使用并且似乎遇到了麻烦:
require(RSelenium) RSelenium::startServer() remDr <- remoteDriver(browserName = "phantomjs",extraCapabilities = list(phantomjs.binary.path = "C:/Users/home/Desktop/phantomjs-1.9.8-windows/phantomjs.exe")) remDr$open() 这导致: $class [1] "org.openqa.selenium.UnsupportedCommandException" $additionalInformation [1] "nDriver info: driver.version: unknown" 我的sessionInfo()如下: $class [1] "org.openqa.selenium.UnsupportedCommandException" $additionalInformation [1] "nDriver info: driver.version: unknown" 更新: [1] "Connecting to remote server" Error: Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. class: java.lang.ClassNotFoundException 解决方法
此问题已修复
https://github.com/ropensci/RSelenium/commit/462ff26eb0e5578181b80cb5bc002ac1e8e68306.您可以尝试以下方法:
devtools::install_github("ropensci/RSelenium") require(RSelenium) psPath <- "C:/Users/home/Desktop/phantomjs-1.9.8-windows/phantomjs.exe" RSelenium::startServer() remDr <- remoteDriver(browserName = "phantomjs",extraCapabilities = list(phantomjs.binary.path = psPath)) remDr$open() 更新: 这似乎是新的2.44 selenium服务器和ghostdriver的问题,现在你可以在没有Selenium Server的情况下直接驱动幻像,直到问题在上游修复,或者你可以使用旧版本的Selenium Server(2.43正在使用ghostdriver): # DRIVE phantomJS DIRECTLY require(RSelenium) # devtools::install_github("ropensci/RSelenium") # if the latest dev version is not currently installed psPath <- "C:/Users/home/Desktop/phantomjs-1.9.8-windows/phantomjs.exe" pJS <- phantom(pjs_cmd = psPath) remDr <- remoteDriver(browserName = "phantomjs") remDr$open() # pJS$stop() # to close phantom server (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 在为Windows操作系统中的大文件计算SHA-1哈希时,Python崩溃
- windows – 如何管理服务帐户凭据(密码)?
- SCP将windows本地文件复制到linux远程文件夹
- Windows系统调用中API的3环部分(依据分析重写ReadProcessMe
- 在Windows下Kafka的基本配置及简单使用
- Windows – 远程桌面客户端找不到远程计算机
- windows-7 – 如何防止Windows 7远程桌面超时?
- 如何在WPF中将样式应用于Window Control?
- windows – Delphi 7可以通过OLE Variant传递Int64值吗?
- Exchange DAG自动故障转移 – 原因
推荐文章
站长推荐
热点阅读