4

My problem is related to this post: session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium. Basically there is a mismatch between the version of chrome and chromedriver that's sourced by the code.

I'm running chrome 73.0.3683.86 (Official Build) (32-bit) on a corporate computer (so can't be upgraded) and have downloaded chromedriver (v73.0.3683.68) which has been saved to the path (saved to users path as I can't access system path). R version is 3.6.2. RSelenium version is 1.7.7.

cprof <- getChromeProfile("C:/Users/sizhu/AppData/Local/Google/Chrome/UserData/Default","Default")
rD1 <- rsDriver(browser = "chrome",chromever =  "73.0.3683.68",extraCapabilities = cprof)

When I ran the above lines, it gives me error: version requested doesn't match versions available = 80.0.3987.106,80.0.3987.16,81.0.4044.20,81.0.4044.69

I have run binman::list_versions("chromedriver") to see what chrome driver version is sourced, it shows the ones above in bold and not the one I saved in the path. Is there a way to force the program to use the chrome driver I downloaded? (sorry I'm a newbie to programming in general so it might just be very trivial...)

Thanks very much in advance!

update not quite an eventual solution to this but made some changes so the codes can now open up the chrome browser: 1)going into wdman>yaml>chromedriver 2)change history to 20 (it was 3 hence every time I run this line, 3 latest chromever drivers (v80-81) are downloaded to binman; well since what I need is v73, I need to go back 20 versions) 3)save and specify chromever = "73.0.3683.68" which can now be found. The problem with this approach is obvious, and still doesn't solve the puzzling fact that why the heck the v73 chromedriver that I've saved to the path is not found

jsqzhu
  • 41
  • 4
  • Not sure which operating system you are using but for windows I use this method in case the chromedriver.exe is in the path, open command prompt and type in chromedriver.exe it will run the driver exe as its available in the path variable. Than go to task manager and check the path from which it picks up the exe. Same you can do with linux with ```ps -axe | grep 'chromedriver'``` command – Sariq Shaikh Mar 20 '20 at 12:15
  • I'm running windows 10. Just ran "chromedriver.exe" and got " 'chromedriver.exe' is not recognized as an internal or external command,operable program or batch file." How should I go from there? Thanks so much! – jsqzhu Mar 20 '20 at 16:01
  • So chromedriver.exe is not In the path. You can even simply find chromedriver.exe using windows search and than remove the exe which you think is causing the problem. – Sariq Shaikh Mar 20 '20 at 17:01
  • Okay will try that - does that make sense if I already added to the user path and when I typed in Path in command prompt I can see C:\Webdrivers (where v73 chromedriver is stored) is there..any chance this has to do with the fact that I don't have admin rights to this computer? – jsqzhu Mar 20 '20 at 17:28
  • What does `where chromedriver` show you from the Windows command line? You might have multiple ChromeDriver's in your %PATH%, and it uses the first one it finds. – Greg Burghardt Mar 20 '20 at 18:11
  • You should be able to specify the path to the driver when initializing the ChromeDriver object. I'm not sure what the API would be in r, though. – Greg Burghardt Mar 20 '20 at 18:17
  • See https://chromedriver.chromium.org/getting-started for more information, but their code examples are in Java and Python. – Greg Burghardt Mar 20 '20 at 18:19
  • Greg, it returns: Could not find files for the given pattern(s). I did find some files as per Sariq's suggestion: 1)tried deleting the ones in \AppData\Local\binman\binman_chromedriver\win32\"version number" - doesnt work as they were added back in as soon as I ran the code 2)deleted C:\Users\sizhu\Documents\R\win-library\3.6\wdman\yaml - the code is now returning a new error: Error in `[[<-`(`*tmp*`, platvec, value = switch(Sys.info()["sysname"], : no such index at level 1. Wdman is still there (checked with library(wdman)) now I'm trying to figure out what this yaml does ... – jsqzhu Mar 20 '20 at 18:24

2 Answers2

2

If you are using Chrome version 81, please download ChromeDriver 81.0.4044.69

If you are using Chrome version 80, please download ChromeDriver 80.0.3987.106

If you are using Chrome version 79, please download ChromeDriver 79.0.3945.36

https://chromedriver.chromium.org/downloads

0

Had a similar issue, and this worked for me.

Check the selenium server version: binman::list_versions("seleniumserver"),

and then in your rsDriver(), specify the version out, not using "latest" or default.

rD1 <- rsDriver(browser = "chrome", chromever =  "73.0.3683.68", version = "the version number you got", extraCapabilities = cprof)
K.-T. Chen
  • 11
  • 3