0

I've been successfully working with Excel VBA, SeleniumBasic and Google Chrome for years. Recently, with version 115, Chrome changed the ChromeDriver process and I found no documentation on how to carry on with the new process (I'm not an IT expert but can follow instructions).

Here is an extract of my current code that worked until version 114 included:

Option Explicit
'===================
Sub test_open_selenium_chrome_115()
'extract of previous code that worked until Version 114 included (/114.0.5735.90/)

Dim bot As New Selenium.ChromeDriver
bot.SetPreference "profile.managed_default_content_settings.images", 2
bot.SetPreference "profile.managed_default_content_settings.geolocation", 2
bot.AddArgument ("start-maximized") '// https://stackoverflow.com/a/26283818/1689770
bot.AddArgument ("enable-automation") '// https://stackoverflow.com/a/43840128/1689770
bot.AddArgument ("--no-sandbox") '//https://stackoverflow.com/a/50725918/1689770
bot.AddArgument ("--disable-infobars") '//https://stackoverflow.com/a/43840128/1689770
'...
bot.AddArgument "--disable-blink-features=AutomationControlled" 'Removing Navigator.Webdriver Flag
bot.AddArgument "user-data-dir=selenium" 'to keep cookies and avoid site to detect Selenium
'to add Chrome extensions : https://www.reddit.com/r/learnpython/comments/4zzn69/how_do_i_get_adblockplus_to_work_with_selenium/
bot.AddArgument "load-extension=C:\OQP\Extensions_chrome"
bot.AddArgument "load-extension=C:\OQP\Extensions_chrome\1.37.2_0"
'...
bot.AddArgument "--user-data-dir=C:\OQP\Extensions_chrome"
bot.AddArgument "--user-data-dir=C:\OQP\Extensions_chrome\1.37.2_0" 'ublock
'...

'Google Chrome version 115 has modified the chromedrivers process and it does not work any longer
'source: https://stackoverflow.com/questions/76770921/chrome-driver-manager-not-working-on-chrome-version115-0-5790
'infos about versions: https://googlechromelabs.github.io/chrome-for-testing/

bot.Start "chrome"
End Sub

What should I change, how and where to recover?

tibibou
  • 164
  • 10
  • What is the error you receive? – igittr Jul 29 '23 at 17:45
  • It either starts and immediately closes, or I get error 13, unknown error: cannot parse internal JSON template: Line1, column 1, unexpected token. (Driver info: chromedriver = 114.0.5735.90 and then something that may look at a strange kind of address – tibibou Jul 29 '23 at 21:23
  • 1
    Successfully tested SeleniumBasic with ChromeDriver 115 just now ... version of Chrome 115.0.5790.110, ChromeDriver 115.0.5790.102 win64 version from https://googlechromelabs.github.io/chrome-for-testing/#stable (via https://sites.google.com/chromium.org/driver/?pli=1), VBA host Excel 365, 64 bit, running in Windows 10 ... process just as-per previous, download and copy matching ChromeDriver version to SeleniumBasic folder (on my device "C:\Users\myusername\AppData\Local\SeleniumBasic") – JohnM Jul 30 '23 at 06:16
  • Thank you, I followed your suggestion and it works again. Things that changed: I moved from the 32-bit version to the 64-bit one. I had to remove two lines: bot.AddArgument "--user-data-dir" and bot.AddArgument "user-data-dir=selenium" – tibibou Jul 30 '23 at 22:15
  • The direct link to find the right driver is: https://googlechromelabs.github.io/chrome-for-testing/ and you have to pay attention to the multiple choices (stable or not stable...)! – tibibou Jul 30 '23 at 22:19

0 Answers0