寻求有关如何解决主题行错误的帮助。
这里引用的许多以前的帖子和解决方案已经被审查/尝试过。
在过去,通过更新R,Rstudio解决了相同的错误。
- 该代码已运行多年,最近几天才生效:**
library(chromote) # to get the chrome version
library(netstat) # to dynamically change ports
library(RSelenium) # to run Selenium
b <- ChromoteSession$new()
browser_version <- b$Browser$getVersion()$product
browser_version<-gsub(".*/","",browser_version)
realVersion <- substr(browser_version,1,3)
chromeVersions <- binman::list_versions("chromedriver")
chromeVersions <- chromeVersions$win32
realChromeVer <-chromeVersions[which(substr(chromeVersions,1,3)==realVersion)]
driver <- rsDriver(browser = 'chrome', port = free_port(random = TRUE), chromever = realChromeVer[1], verbose = F)
remdr <- driver[['client']]
remdr$maxWindowSize()
- 错误消息:**
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 3918: Connection refused
Check server log for further details.
Warning message:
In rsDriver(browser = "chrome", port = free_port(random = TRUE), :
Could not determine server status.
有没有办法让rsDriver运行这个程序?
如果有人能帮我解决这个问题,我将非常感激。
1条答案
按热度按时间mnemlml81#
请在此处https://stackoverflow.com/a/75176907/15363011和此处https://github.com/ropensci/RSelenium/issues/264查看答案
这个问题很可能是最新的Chrome版本(109+)产生了一个阻止
wdman::selenium()
运行的bug。您是否尝试过删除RSDriver设置的Chrome驱动程序路径中的许可证文件(通过wdman包)?