Problem using Selenium: chromedriver and geckodriver don't work

I failed using Selenium either with Chrome or firefox

Screenshots, links, or other helpful context:
https://replit.com/@baticalcul/selenium-tests?v=1

error message with Chome:

selenium.common.exceptions.WebDriverException: Message: Service /home/runner/.cache/selenium/chromedriver/linux64/114.0.5735.90/chromedriver unexpectedly exited. Status code was: 127

Error message with firefox

The geckodriver version (0.33.0) detected in PATH at /nix/store/ql9viif8hfcmwc0scbva3yx29n8zdl80-geckodriver-0.33.0/bin/geckodriver might not be compatible with the detected firefox version (123.0); currently, geckodriver 0.34.0 is recommended for firefox 123.*, so it is advised to delete the driver in PATH and retry

the code is simple

from selenium import webdriver
print("hello world")
driver = webdriver.Chrome()
# driver = webdriver.Firefox()
driver.quit()
print("byebye world")

my nix file:

{pkgs}: {
  deps = [
    pkgs.geckodriver
    pkgs.chromium
  ];
}

I found an answer on youtube, at least for Chrome:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
print("hello world")

chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options= chrome_options)
# driver = webdriver.Firefox()
# driver = webdriver.Edge()
url = "https://www.youtube.com/"
driver.get(url)

driver.quit()
print("byebye world")

and nix file:

{pkgs}: {
  deps = [
    pkgs.geckodriver
    pkgs.chromium
    pkgs.chromedriver
  ];
}