简体   繁体   中英

could not open chrome browser in R

I use RSelenium package for web scraping and 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?

Not sure if you still looking for an Answer as this is nearly 6 month old Q'n.

But just cross check if you have set Chrome path correctly in environment variables or not.

You can do it by running simple command in cmd prompt > Chrome on windows-10运行这将打开一个空白的 chrome 浏览器窗口,如下所示

if not done then you'll get an error says- 'chrome' is not recognized as an internal or external command, operable program or batch file'.

then you have to add chrome installable path to environment variables as below- in win-10 C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe

In case you don't know how to do this- it can be done as per below snap.

如何将 chrome 添加到 PATH ..

Hope this Helps..!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM