Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python Selenium Beta Chrome driver uses wrong binary path

I’m currently switching from chrome 102 to 104 Beta (since 103 has an unfixed error for my use case with a python – selenium script)

I installed the Chrome Beta 104 + the 104 chrome driver.
When I start up the script it recognizes that it’s a 104 driver but the driver itself searches for the chrome.exe application within the old chrome path:

Where it searches right now:
C:\Program Files\Google\Chrome\Application\chrome.exe

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Where it should search for:
C:\Program Files\Google\Chrome Beta\Application\chrome.exe

Is there some simple way of changing the binary path where the beta chrome driver searches for the exe? Something simple I could put within my python script would be lovely.

>Solution :

In that case, you should specify where selenium has to look to find your chrome executer with binary_location inside the Options class.

Try this one out:

Assuming your chromedriver.exe and python file are on the same folder, otherwise you’ll have to specify the path of the chromedriver.exe as well.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service

options = Options()
options.binary_location = r'C:\Program Files\Google\Chrome Beta\Application\chrome.exe'
browser = webdriver.Chrome(options = options, service = Service("chromedriver.exe"))

browser.get(your_url)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading