I'm using the following code in RSelenium to open a browser. After I close the browser, or even close the handler by running remDr$close(), the port is still in use. I have to go to the terminal and manually kill the process so that the same port becomes available. Is there any automated way such that RSelenium makes the port free after it finishes scraping?
So here is my code:
library(RSelenium)
rD <- rsDriver(verbose = FALSE,port=4444L)
remDr <- rD$client
remDr$close()
Thanks