RSelenium icon indicating copy to clipboard operation
RSelenium copied to clipboard

Error could not open chrome browser

Open fatimamb opened this issue 6 years ago • 8 comments

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?

fatimamb avatar May 14 '19 11:05 fatimamb

Second the error messages.

ponnet avatar Jun 05 '19 19:06 ponnet

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>

clsalinas avatar Jun 13 '19 19:06 clsalinas

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)

aguga491 avatar Jul 30 '19 01:07 aguga491

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

Danny-dK avatar Sep 04 '19 08:09 Danny-dK

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!

calvinchengyx avatar Mar 13 '20 04:03 calvinchengyx

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

gmanova avatar Oct 16 '20 17:10 gmanova

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

oguzozbay avatar Jan 05 '21 14:01 oguzozbay

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

Danny-dK avatar Oct 18 '21 08:10 Danny-dK