RSelenium: A wonderful tool for web scraping.

For one of my projects, I needed to fetch data in R from online sources. We all know that its a common practice to collect data from Twitter, Facebook and other online social media websites and analyse them. I used to do the same using the XML package until a problem occurred while scraping data from this. Even after looking up the internet, I was unable to find a solution. Hence, I raised my concern at Stackoverflow where one was generous enough to tell me about the RSelenium package. And trust me, I fell in love with this package. Kudos to it’s author.

But I will have to admit, I faced lots of trouble while using this package even after following the steps mentioned here. The following steps are written in a simple but detailed manner to easily setup the RSelenium package.

Step 1: install.packages(“RSelenium”).

Step 2: library(“RSelenium”).

Step 3 : checkForServer().

This function will download the jar file and will place it in the bin directory of the package “RSelenium”. If you wish to download elsewhere you can mention it with dir argument in the method. You can also manually download it from here.

Step 4: startServer().

This method will start the standalone server after trying to locate it in bin directory by default. If you have placed it in any other directory, mention it in the dir argument of the method.

Sometimes this method throws errors. To get more clear insight into the errors, I prefer this alternative way. Navigating to location of the server from console of my OS (i.e command prompt in Windows or the terminal in Ubuntu), the following command is to be run:

java -jar selenium-server-standalone-x.xx.x.jar

This will show all the status messages in the console and accordingly you can debug them.

Step 5:

remDr <- remoteDriver(remoteServerAddr = "localhost" 
         , port = 4444
         , browserName = "firefox"
         )

These are already the default parameters of remoteDriver(). So if you want to stick to these parameters you can simply type remoteDriver(). But, I preferred using chrome. For using chrome, I downloaded chromedriver executable from here and added the location of downloaded executable to the system PATH . Folllow the following steps:

  • Click Start > Control Panel > System > Advance system settings > Environment Variables > System Variables.
  • Scroll to Path and double click.
  • At the end of Variable value: add ;C:\path\directory that holds the chromedriver.exe file. (; separates the paths)

If you now run the executable, the port number (say 9517) where the chromedriver is running will be shown. Replace the following parameters now :

remDr <- remoteDriver(remoteServerAddr = "localhost" , port = 9517 , browserName           = "chrome")

Visit this to find out more about other browsers.

Step 6: If you now visit http://localhost:9517/selenium-server/driver?cmd=getLogMessages, you will be able to check for the existence of the server.

You can additionally visit http://localhost:9517/selenium-server/driver?cmd=shutDownSeleniumServer to shut down the RSelenium server.

Step 7: The following method will create session id.

remDr$open()

Step 8:  If you want to query the status of the server you can use this method.

remDr$getStatus()

You are now connected to RSelenium and can work with it to collect data. If you face any problem, take some time to drop your comments down here.

Happy Mining!

Advertisements

17 thoughts on “RSelenium: A wonderful tool for web scraping.

  1. I couldn’t install both startServer and also java -jar selenium-server-standalone-x.xx.x.jar. the respond is error and unable to start Selenium binary for startServer().

    meanwhile for java -jar selenium-server-standalone-x.xx.x.jar the respond is unexpected symbol in “java -jar selenium”.
    What’s wrong with my script or R program?
    Thank you

    Like

    • Hi Bobby,
      So basically I think you have run the code “java -jar selenium-server-standalone-x.xx.x.jar” from the RStudio console.
      However its specifically mentioned to run the server through the Windows / Mac / Ubuntu console:
      “Navigating to location of the server from console of my OS (i.e command prompt in Windows or the terminal in Ubuntu), the following command is to be run:”

      Please ensure your Java is installed properly with a path in the System variables and use a OS console such as CMD or Bash to go the directory with the jar file and then run the above command through that console. The default port used is 4444. If you want to change the port you might want to use this option:
      “java -jar selenium-server-standalone.jar -port xxxx”

      Do post further queries for any problems. 🙂

      Liked by 1 person

  2. Hi, I am facing problem when running command remDr$open()

    on RConsole :-
    > remDr remDr$open()
    [1] “Connecting to remote server”
    No encoding supplied: defaulting to UTF-8.
    Error in resContent[[“status”]] : subscript out of bounds

    this is displayed where the selenium server is running :–
    20:39:09.369 INFO – Selenium Server is up and running
    20:44:22.070 INFO – SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000
    20:44:22.108 INFO – Executing: [new session: Capabilities [{browserName=chrome}]])
    20:44:22.134 INFO – Creating a new session for Capabilities [{browserName=chrome}]
    20:44:22.286 WARN – Exception thrown
    java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
    Build info: version: ‘3.0.0’, revision: ‘350cf60’, time: ‘2016-10-13 10:48:16 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: driver.version: unknown
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
    at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:119)
    at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
    at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:131)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:36)
    at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
    at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:189)
    at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:222)
    at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:184)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:150)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.seleniumhq.jetty9.server.Server.handle(Server.java:499)
    at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:310)
    at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.seleniumhq.jetty9.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
    Build info: version: ‘3.0.0’, revision: ‘350cf60’, time: ‘2016-10-13 10:48:16 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: driver.version: unknown
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:209)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    … 1 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
    … 9 more
    Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
    at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:142)
    … 14 more
    20:44:22.312 WARN – Exception: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

    Please assist me.
    Thanks.

    Like

    • Hi Akshay,
      Sorry, we did not receive your comment properly. It was sent to the spam box, probably due to redundancy of multiple lines or the length of the comment.
      Either way, I am going through it at the moment and will reply as soon as possible.

      Thank You. Happy Mining.

      Liked by 1 person

  3. errors,

    > remDr remDr$open()
    [1] “Connecting to remote server”
    No encoding supplied: defaulting to UTF-8.
    Error in resContent[[“status”]] : subscript out of bounds

    selenium server logs:–

    20:39:09.369 INFO – Selenium Server is up and running
    20:44:22.070 INFO – SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000
    20:44:22.108 INFO – Executing: [new session: Capabilities [{browserName=chrome}]])
    20:44:22.134 INFO – Creating a new session for Capabilities [{browserName=chrome}]
    20:44:22.286 WARN – Exception thrown
    java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
    Build info: version: ‘3.0.0’, revision: ‘350cf60’, time: ‘2016-10-13 10:48:16 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: driver.version: unknown
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
    at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:119)
    at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
    at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:131)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:36)
    at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
    at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:189)
    at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:222)
    at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:184)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:150)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.seleniumhq.jetty9.server.Server.handle(Server.java:499)
    at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:310)
    at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.seleniumhq.jetty9.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
    Build info: version: ‘3.0.0’, revision: ‘350cf60’, time: ‘2016-10-13 10:48:16 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: driver.version: unknown
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:209)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    … 1 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
    … 9 more
    Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
    at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:142)
    … 14 more
    20:44:22.312 WARN – Exception: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

    please assist.
    thanks.

    Liked by 1 person

    • Hi Akshay,
      It seems your selenium server is not running properly. It might have something to do with the chrome-driver that you are using. Ensure you are using the latest chrome-driver from here – http://chromedriver.storage.googleapis.com/index.html.

      If in case it is indeed the latest version, you might not have set the path to the chrome-driver properly as is mentioned here:
      20:44:22.312 WARN – Exception: The path to the driver executable must be set by the webdriver.chrome.driver system property.

      I believe if you can get these two done correctly, you will be able to see the web instance running through this:
      localhost:/wd/hub/static/resource/hub.html

      You can then either create a new session through the chrome UI or use remDr$open() to start a new session. Remember, it will use default values unless you change the port or other values explicitly.

      If none of the above mentioned points are solutions to your problem, please report again.

      Thanks. Happy mining!

      Liked by 1 person

  4. running on chrome – 55
    selenium standalone server – 3.0.1
    chromedriver – 2.27
    R – 3.3.2

    Also, on browser if i am able to open localhost:4444 and create new session there , but when i try to load script.a pop up says unable to load url.

    Thanks.

    Liked by 1 person

  5. i just followed you, installed 2.9 version of chromedriver, but same problem occurs

    selenium server logs :–

    $ java -jar -Dwebdriver.chrome.driver=/home/hdpusr/ChromeDriver/chromedriver selenium-server-standalone-3.0.1.jar
    13:23:04.565 INFO – Selenium build info: version: ‘3.0.1’, revision: ‘1969d75’
    13:23:04.565 INFO – Launching a standalone Selenium Server
    2017-01-24 13:23:04.584:INFO::main: Logging initialized @352ms
    13:23:04.644 INFO – Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
    registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
    13:23:04.645 INFO – Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
    registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
    13:23:04.645 INFO – Driver class not found: com.opera.core.systems.OperaDriver
    13:23:04.645 INFO – Driver provider com.opera.core.systems.OperaDriver registration is skipped:
    Unable to create new instances on this machine.
    13:23:04.645 INFO – Driver class not found: com.opera.core.systems.OperaDriver
    13:23:04.645 INFO – Driver provider com.opera.core.systems.OperaDriver is not registered
    13:23:04.646 INFO – Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
    registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
    2017-01-24 13:23:04.689:INFO:osjs.Server:main: jetty-9.2.15.v20160210
    2017-01-24 13:23:04.723:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@6d8a00e3{/,null,AVAILABLE}
    2017-01-24 13:23:04.748:INFO:osjs.ServerConnector:main: Started ServerConnector@38348dfa{HTTP/1.1}{0.0.0.0:4444}
    2017-01-24 13:23:04.749:INFO:osjs.Server:main: Started @517ms
    13:23:04.749 INFO – Selenium Server is up and running

    13:24:58.209 INFO – SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000
    13:24:58.242 INFO – Executing: [new session: Capabilities [{nativeEvents=true, browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]])
    13:24:58.262 INFO – Creating a new session for Capabilities [{nativeEvents=true, browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]
    Starting ChromeDriver (v2.9.248304) on port 11510
    13:24:58.677 INFO – Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
    [0.060][WARNING]: PAC support disabled because there is no system implementation
    13:25:58.760 INFO – Detected dialect: OSS
    13:25:58.798 INFO – Done: [new session: Capabilities [{nativeEvents=true, browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]]
    13:26:55.511 INFO – Executing: org.openqa.selenium.remote.server.handler.GetAllSessions@3cae4ba4)
    13:26:55.518 INFO – Done: org.openqa.selenium.remote.server.handler.GetAllSessions@3cae4ba4
    13:26:58.333 INFO – Executing: org.openqa.selenium.remote.server.handler.GetAllSessions@61e4991)
    13:26:58.334 INFO – Done: org.openqa.selenium.remote.server.handler.GetAllSessions@61e4991

    13:27:19.044 INFO – Executing: [get: http://www.google.com?wdsid=83b9cea3-acd5-466e-b5de-0335523c4350&wdurl=http%3A%2F%2Flocalhost%3A4444%2Fwd%2Fhub%5D)
    No protocol specified
    13:27:19.108 WARN – Exception thrown
    org.openqa.selenium.NoSuchSessionException: no such session
    (Driver info: chromedriver=2.9.248304,platform=Linux 3.19.0-64-generic x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 23 milliseconds
    Build info: version: ‘3.0.1’, revision: ‘1969d75’, time: ‘2016-10-18 09:48:19 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Capabilities [{message=unknown error: Chrome failed to start: exited abnormally
    (Driver info: chromedriver=2.9.248304,platform=Linux 3.19.0-64-generic x86_64), platform=ANY}]
    Session ID: 4fbd2eb9ad6274712f2173a25539eb5d
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103)
    at com.sun.proxy.$Proxy4.get(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver.get(EventFiringWebDriver.java:162)
    at org.openqa.selenium.remote.server.handler.ChangeUrl.call(ChangeUrl.java:40)
    at org.openqa.selenium.remote.server.handler.ChangeUrl.call(ChangeUrl.java:25)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    13:27:19.112 WARN – Exception: no such session
    (Driver info: chromedriver=2.9.248304,platform=Linux 3.19.0-64-generic x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 23 milliseconds
    Build info: version: ‘3.0.1’, revision: ‘1969d75’, time: ‘2016-10-18 09:48:19 -0700’
    System info: host: ‘akshay-300E4Z-300E5Z-300E7Z’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-64-generic’, java.version: ‘1.8.0_121’
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Capabilities [{message=unknown error: Chrome failed to start: exited abnormally
    (Driver info: chromedriver=2.9.248304,platform=Linux 3.19.0-64-generic x86_64), platform=ANY}]
    Session ID: 4fbd2eb9ad6274712f2173a25539eb5d

    Like

      • Hi,

        Now this is what the error is :-

        > remDr remDr$open()
        [1] “Connecting to remote server”
        $webdriver.remote.sessionid
        [1] “27223e7b-e0ef-4957-b5e4-a3561f770194”

        $locationContextEnabled
        [1] TRUE

        $webStorageEnabled
        [1] TRUE

        $takesScreenshot
        [1] TRUE

        $javascriptEnabled
        [1] TRUE

        $message
        [1] “unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.19.0-64-generic x86_64)”

        $hasTouchScreen
        [1] TRUE

        $platform
        [1] “ANY”

        $cssSelectorsEnabled
        [1] TRUE

        $id
        [1] “27223e7b-e0ef-4957-b5e4-a3561f770194”

        Liked by 1 person

    • So the above error posted by is definitely pointing to 2 things:
      * Chrome failed to start: exited abnormally.
      * Driver info: chromedriver=2.27.440175.
      You may not have started the chromedriver with the latest version that is 2.9.
      It definitely means that a new session cannot be created and hence chrome has exited abnormally.
      If incase you have multiple copies of chromedriver on your machine, please make sure that the PATH variable in the system environment is pointing to the correct (latest) one.

      Like

      • Hi Ginnalin,
        I had already tried with 2.9 version of chromedriver as you suggested me in an earlier comment, but the same error occurred and i also had sent you the logs in this comment earlier :-
        https://fordoxblog.wordpress.com/2016/09/11/rselenium-a-wonderful-tool-for-web-scraping/#comment-20

        However i found out, i may be wrong, that chromedriver 2.27 is the latest release so I reinstalled it to 2.27 and had sent you the logs again.

        Every time I download/install a driver version I made sure that i deleted the previous one, so there is only one copy of chromedriver right now.

        I have decided to remove chrome, chromedriver, Rselenium (i don’t think i need to reinstall RConsole) completely and reinstall them.

        can you please suggest me the proper combination of versions of all of them that I should install.

        Thanks Again Ginnalin.

        Like

  6. Hello Akshay,

    Latest Release: ChromeDriver 2.27 supports Chrome v54-56. What is the version of Chrome your are using? And also make sure you set the path of the driver properly after installation.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s