Trying to get selenium working

Thanks Igor,

That’s got me to the next step which is awesome, but then now I’m encountering the below:

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace: #0 0x561990bf7aa9 <unknown>

Code below:
!pip install --upgrade webdriver-manager
!pip install --upgrade selenium

# !cd /data/notebook_files/
!sudo apt update
!sudo apt install -y chromium-browser
# !sudo apt install -y chromium-chromedriver
!export PATH="/data/workspace_files:$PATH"
!export PATH="/data/notebook_files:$PATH"

import os

import sys

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
driver_path = r'/data/notebook_files/chromedriver'
sys.path.insert(0, driver_path)
os.chmod(driver_path, 0o755)

options = Options()

# options.binary_location = driver_path

options.binary_location = r'/usr/bin/chromium-browser'
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--disable-dev-shm-usage')
service = Service(executable_path=driver_path)
driver = webdriver.Chrome(service=service,options=options)

I’ve made sure to use the suitable version of chromedriver (85.0.4183.83, as you can see I tried to get via terminal but didn’t have much luck there so reverted back to the manually downloaded copy) and have tried a few suggestions from what I could see on the internet but have not had much luck.

Any help is appreciated.