【发布时间】:2021-05-13 10:30:06
【问题描述】:
我正在尝试在我公司的代理后面运行 RSelenium,并且可以通过 GET 请求成功连接,但我无法正确运行 rsDriver() 函数。
set_config(use_proxy(url = "proxy.company.com",
port = 80,
username = "greg",
password = "password"))
执行此操作后,我可以成功运行 GET 请求,如果不使用 setconfig,我将无法执行:
> GET("http://google.com")
Response [http://www.google.com/]
Date: 2021-02-09 18:30
Status: 200
我尝试使用 rsDriver 时遇到了与 Chrome 或 Firefox 的连接问题:
cprof <- list(chromeOptions =
list(args = list("--proxy-server=proxy.company.com")))
driver <- rsDriver(browser = c("chrome"), extraCapabilities = cprof)
检查 Selenium 服务器版本: 开始:预下载 open.connection(con, "rb") 中的错误: 已达到超时:[www.googleapis.com] 操作在 10014 毫秒后超时,收到 0 个字节中的 0 个
我也尝试使用 Docker 客户端运行,但尝试连接后收到一条奇怪的消息:
> remDr <- remoteDriver(remoteServerAddr = "127.0.0.1", port = 444L)
> remDr$open()
[1] "Connecting to remote server"
$id
[1] NA
我很困惑为什么无论我尝试什么都无法让它发挥作用。任何指导都可以挽救生命。
谢谢你
【问题讨论】:
-
这段代码是否对您有用,但有一天突然停止工作?
标签: r docker proxy rselenium rsdriver