ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
343 stars 81 forks source link

Error could not open chrome browser #203

Open fatimamb opened 5 years ago

fatimamb commented 5 years ago

hello I have worked with this code from 2 weeks ago and it was worked

library(RSelenium)
driver <- rsDriver(port=4444L,browser="chrome")
remote_driver <- driver$client

but I had some issue in another project so I had to update all my packages. so after that when I am trying to work with the same code I get this error

Could not open chrome browser. Client error message: Summary: SessionNotCreatedException Detail: A new session could not be created. Further Details: run errorDetails method Check server log for further details.

and sometimes this error

Error in wdman::selenium(port = port, verbose = verbose, version = version,  : 
  Selenium server signals port = 4444 is already in use.

I don't know if that because I updated the packages or what? any help?

ponnet commented 5 years ago

Second the error messages.

clsalinas commented 5 years ago

Have you tried changing the port? Or killing the active process on the active port? In terminal: lsof -i :4444 get PID of the active processes kill -9 <PID>

aguga491 commented 5 years ago

Hello,

I have the same issue. I don´t get solve it. I try update rstudio, chorme beta, firefox but not work as well.

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 76 Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'

My code is very simple:

library(RSelenium) cprof <- getChromeProfile( "C:\Users\Dell\AppData\Local\Google\Chrome Beta\User Data", "Default" ) driver <- rsDriver(port = 4567L,browser=c("chrome"), , extraCapabilities = cprof)

remDr <- remoteDriver(browserName = "chrome", extraCapabilities = cprof)

Danny-dK commented 5 years ago

The original problem post is that the port is in use. Use a different port (you can try different numbers):

library(RSelenium)
rD1 <- rsDriver(browser = "chrome", port = 4567L, geckover = NULL, 
                chromever =  "latest", iedrver = NULL, 
                phantomver = NULL, extraCapabilities = cprof)
remDr1 <- rD1[["client"]] 

When you're done doing what you wanted to do:

remDr1$close()
rD1$server$stop() 
rm(rD1, rD2)
gc()

The second post problem is that the driver is not compatible with the current version of chrome. Open chrome and check the version of chrome (at the 3-dot menu --> help --> about chrome). Check your available driver versions using this code in R:

binman::list_versions("chromedriver")

Find the chromedriver version that closely matches your chromeversion and use that in your rsDriver command (see above).

As drivers may be updated regularly, see here or here

calvinchengyx commented 4 years ago

The original problem post is that the port is in use. Use a different port (you can try different numbers):

library(RSelenium)
rD1 <- rsDriver(browser = "chrome", port = 4567L, geckover = NULL, 
                chromever =  "latest", iedrver = NULL, 
                phantomver = NULL, extraCapabilities = cprof)
remDr1 <- rD1[["client"]] 

When you're done doing what you wanted to do:

remDr1$close()
rD1$server$stop() 
rm(rD1, rD2)
gc()

The second post problem is that the driver is not compatible with the current version of chrome. Open chrome and check the version of chrome (at the 3-dot menu --> help --> about chrome). Check your available driver versions using this code in R:

binman::list_versions("chromedriver")

Find the chromedriver version that closely matches your chromeversion and use that in your rsDriver command (see above).

As drivers may be updated regularly, see here or here

Thanks very much ! it works for me!

gmanova commented 4 years ago

@Danny-dK you are a godsend with this chrome version check. did the trick!

oguzozbay commented 3 years ago

go to https://cnpmjs.org/downloads

download phantomjs-2.1.1-windows.zip

paste both ziped and unzipped "phantomjs-2.1.1-windows.zip" under C:\Users\YOURUSERNAME\AppData\Local\binman\binman_phantomjs\windows\2.1.1

Danny-dK commented 3 years ago

update: please see the great work of salim-b at #237 for proper detection of chrome driver