I have a python script where it autoinstalls chromedriver with ChromeDriverManager
package. Today it gave me an error of:
No such driver version 115.0.5790.110 for linux64
Line of code:
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=chrome_options)
ChromeDriverManagergoes to the url and istalls LATEST RELEASE
of chrome driver. I looked at last modified version, it says on may of 2023. But SO says it is having an issue newly. My script also was working a week ago.
<Contents>
<Key>LATEST_RELEASE</Key>
<Generation>1685523462105569</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2023-05-31T08:57:42.224Z</LastModified>
<ETag>"368684b889419678b04e4899d53d7ab0"</ETag>
<Size>13</Size>
</Contents>
I looked at some SO, as I guess it is related new version of chromedriver release which does not function well?
Could anyone assure me that, I got it right, and that means I need to change script to take the old version of chromedriver from path?
If you are using Chrome version 115 or newer you have to check the Chrome for Testing availability dashboard which provides convenient JSON endpoints for specific ChromeDriver version downloading.
With the availability of Selenium v4.6 and above you don't need to explicitly download ChromeDriver, GeckoDriver or any browser drivers as such using webdriver_manager. You just need to ensure that the desired browser client i.e. google-chrome, firefox or microsoft-edge is installed.
Selenium Manager is the new tool integrated with selenium4 that would help to get a working environment to run Selenium out of the box. Beta 1 of Selenium Manager will configure the browser drivers for Chrome, Firefox, and Edge if they are not present on the PATH
.
As a solution you can simply do:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(options=options)
driver.get("https://www.google.com/")
Chrome for Testing: reliable downloads for browser automation