当我想定义 Firefox 配置文件时,为什么 RSelenium 总是出错
Why is RSelenium always giving an error when I want to define a Firefox profile
我正在使用 RSelenium 并想设置 Firefox 配置文件。所以我试图重现 的答案示例。但是,无论我更改什么,我总是会收到以下错误。我做错了什么?
我已经在 RSelenium 手册中读到,对于 windows 系统,当想要制作 Firefox 配置文件时,应该安装 RTools。我做了但没有任何改变。
错误如下:
Error in file(tmpfile, "rb") : cannot open the connection
In addition: Warning messages:
1: running command '"zip" -r9Xjq "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip" "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl/firefoxprofile/prefs.js" ' had status 127
2: In file(tmpfile, "rb") :
cannot open file 'C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip': No such file or directory
问题是 Rselenium 无法创建 Firefox 配置文件的 zip 文件(错误状态 127),因此无法在下一个命令行中读取它。
我解决了这个答案:
Create zip file: error running command " " had status 127.
按照 link 所说的操作,关闭 R,重新启动电脑,它应该可以工作了。
谢谢,
罗布
有时,由于某些原因,将 Rtools 文件位置添加到 环境变量 是不够的 here.要解决此问题,您需要使用以下代码在 R 中添加路径:
writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron")
然后需要重置电脑。之后可以检查路径是否设置正确
Sys.which("make")
## "C:\rtools40\usr\bin\make.exe
如果 sys.which
的输出是 ""
则出现错误。顺便说一下,这里描述了整个过程:https://cran.r-project.org/bin/windows/Rtools/.
我正在使用 RSelenium 并想设置 Firefox 配置文件。所以我试图重现
我已经在 RSelenium 手册中读到,对于 windows 系统,当想要制作 Firefox 配置文件时,应该安装 RTools。我做了但没有任何改变。
错误如下:
Error in file(tmpfile, "rb") : cannot open the connection
In addition: Warning messages:
1: running command '"zip" -r9Xjq "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip" "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl/firefoxprofile/prefs.js" ' had status 127
2: In file(tmpfile, "rb") :
cannot open file 'C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip': No such file or directory
问题是 Rselenium 无法创建 Firefox 配置文件的 zip 文件(错误状态 127),因此无法在下一个命令行中读取它。
我解决了这个答案: Create zip file: error running command " " had status 127.
按照 link 所说的操作,关闭 R,重新启动电脑,它应该可以工作了。
谢谢, 罗布
有时,由于某些原因,将 Rtools 文件位置添加到 环境变量 是不够的 here.要解决此问题,您需要使用以下代码在 R 中添加路径:
writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron")
然后需要重置电脑。之后可以检查路径是否设置正确
Sys.which("make")
## "C:\rtools40\usr\bin\make.exe
如果 sys.which
的输出是 ""
则出现错误。顺便说一下,这里描述了整个过程:https://cran.r-project.org/bin/windows/Rtools/.