Did you manage to sort out your issue?
I am also struggling with Selenium and browser drivers. I have tried various solutions such as checking the browser version with the driver version. I tried Firefox and Chrome. I tried using the absolute PATH to my local PC and also uploaded drivers to the cloud path ‘/data/notebook_files’.
Here is my python code.
!export PATH=“/data/workspace_files:$PATH”
!export PATH=“/data/notebook_files:$PATH”
import stat
import time
import os
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
driver_path = ‘/data/notebook_files/chromedriver.exe’
sys.path.insert(0, driver_path)
os.chmod(driver_path, 0o755)
options = Options()
options.binary_location = driver_path
options.add_argument(‘–no-sandbox’)
st = os.stat(“/data/notebook_files/chromedriver.exe”)
os.chmod(“/data/notebook_files/chromedriver.exe”, st.st_mode | stat.S_IEXEC)
browser = webdriver.Chrome()
driver.get(‘http://www.google.com/’);
It seems that it is finding the exe now however I get the following message
“Traceback (most recent call last):
at cell 3, line 23
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py, line 84, in init(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, service, keep_alive)
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py, line 104, in init(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive)
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py, line 286, in init(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py, line 378, in start_session(self, capabilities, browser_profile)
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py, line 440, in execute(self, driver_command, params)
at /opt/python/envs/default/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py, line 245, in check_response(self, response)
WebDriverException: Message: unknown error: cannot find Chrome binary Stacktrace: #0 0x55b7eb7024e3 #1 0x55b7eb431c76 #2 0x55b7eb458757 #3 0x55b7eb457029 #4 0x55b7eb495ccc #5 0x55b7eb49547f #6 0x55b7eb48cde3 #7 0x55b7eb4622dd #8 0x55b7eb46334e #9 0x55b7eb6c23e4 #10 0x55b7eb6c63d7 #11 0x55b7eb6d0b20 #12 0x55b7eb6c7023 #13 0x55b7eb6951aa #14 0x55b7eb6eb6b8 #15 0x55b7eb6eb847 #16 0x55b7eb6fb243 #17 0x7f553c9a1b43
[1]”
Could you please assist?