【问题标题】:RSelenium issue with startServer() on windowsWindows 上 startServer() 的 RSelenium 问题
【发布时间】:2016-08-13 13:52:47
【问题描述】:

我刚刚从 github 安装了 RSelenium(我通过 cran 安装时遇到了同样的问题),我在 windows 机器中收到以下错误:

Error in if (file.exists(file) == FALSE) if (!missing(asText) && asText ==  : 
  argument is of length zero
In addition: Warning message:
running command '"wmic" path win32_process get Caption,Processid,Commandline /format:htable' had status 44210 

从函数startServer(),这是产生错误的部分:

system2("wmic", args = c("path win32_process get Caption,Processid,Commandline", 
                                    "/format:htable"), stdout = TRUE, stderr = NULL)

当我运行这部分时,我得到以下信息:

character(0)
attr(,"status")
[1] 44210
Warning message:
running command '"wmic" path win32_process get Caption,Processid,Commandline /format:htable' had status 44210 

我的sessionInfo()

R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RSelenium_1.4.2 XML_3.98-1.4    RJSONIO_1.3-0   RCurl_1.95-4.8  bitops_1.0-6   

loaded via a namespace (and not attached):
 [1] httr_1.2.1      R6_2.1.2        tools_3.3.1     withr_1.0.1     curl_1.0        memoise_1.0.0   knitr_1.13      git2r_0.15.0   
 [9] caTools_1.17.1  digest_0.6.9    devtools_1.11.1

【问题讨论】:

  • 如果在 R 会话中运行 system2("wmic", args = c("path win32_process get Caption,Processid,Commandline", "/format:htable"), stdout = TRUE, stderr = NULL) 会返回什么?
  • @jdharrison 我会更新问题
  • 您能否在 win 7 命令行上运行 WMIC path win32_process get Caption,Processid,Commandline /format:htable 并报告它所提供的感谢。
  • @jdharrison Invalid GET Expression. 来自 power shell,Invalid XSL format <or> file name 来自 cmd 感谢您对此进行调查。
  • 如果你在win 7命令行中运行WMIC path win32_process get Caption^,Processid^,Commandline /format:htable

标签: r rselenium


【解决方案1】:

这是 Win 7 的问题。

htable XSL 样式表用于格式化WMIC path win32_process 的输出

使用区域设置时会导致不匹配。给出的可能解决方法是:

  1. 将 C:\Windows\system32\wbem\en-US*.xsl 文件复制或移动到 C:\Windows\system32\wbem\ 文件夹中。
  2. 更改您的区域设置以匹配您的 Windows 语言版本,退出并重新登录。
  3. 指定完整路径:WMIC process get /format:"%WINDIR%\System32\wbem\en-US\csv"

wmic error (invalid XSL format) in windows7中所述

【讨论】:

  • 还有一个关于使用 Docker 和 RSelenium rpubs.com/johndharrison/RSelenium-Docker 的小插图,它应该可以解决许多操作系统/浏览器问题。
  • 会调查的,太好了。再次感谢
猜你喜欢
  • 1970-01-01
  • 2018-11-22
  • 1970-01-01
  • 2023-03-04
  • 1970-01-01
  • 1970-01-01
  • 2014-11-02
  • 1970-01-01
  • 2015-08-26
相关资源
最近更新 更多