RSelenium behind proxy

前端 未结 2 603
遇见更好的自我
遇见更好的自我 2020-12-30 15:29

I am trying to use RSelenium. Here is what I am doing:

library(RSelenium)  
driver<- rsDriver(browser=c(\"chrome\"))
remDr <- driver[[\"client\"]]
remD         


        
2条回答
  •  猫巷女王i
    2020-12-30 16:24

    I use RSelenium with Docker.

    Here is mine option:

    # connect to docker. 
    # need to run in terminal (ctrl + alt + enter)
    docker run -d -p  4445:4444 selenium/standalone-chrome:3.5.3
    eCap <- list(chromeOptions = 
                 list(args = list("--proxy-server=http://47.254.69.158:9999")))
    remDr <- remoteDriver(remoteServerAddr = "localhost",
                      port = 4445L,
                      browserName = "chrome",
                      extraCapabilities = eCap)
    remDr$open()
    remDr$navigate("https://ipinfo.io/")
    remDr$screenshot(display = TRUE)
    

    So i got this this

    If you still have troubles try to switch to other proxy and/or reload Docker.

    Hope this will be usefull.

提交回复
热议问题