Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 667
Mika Cammann Avatar asked Mar 14 '26 00:03

Mika Cammann


1 Answers

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)
like image 129
Shodai Thox Avatar answered Mar 16 '26 13:03

Shodai Thox



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!