A few days ago I was able to use Selenium & Chromium without any problems on Replit.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://www.google.com")
For example, a code like this had opened Google on Replit’s Output tab. I get an error now:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
- (unknown error: DevToolsActivePort file doesn’t exist)*
- (The process started from chrome location /nix/store/z0b6n2bqlssqwd9va76mb8flcwwzywc9-chromium-98.0.4758.102/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)*
Note: I have replit.nix file and it has pkgs.chromium and pkgs.chromedriver
Thanks in advance
Sermet