Running selenium ChromeDriver on Streamlit Community Cloud

Hi, I am having a lot of trouble getting selenium to work upon deploying my Streamlit app. It was working before my attempted deployment. I swear I’ve followed every possible idea I have found on any forum, but every time, without fail, I get the error:

selenium.common.exceptions.WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: 127")

I have both chromium and chromium-driver in packages.txt plus selenium and seleniumbase in requirements.txt

At the moment, my code looks like this, and it worked before deploying.

    from selenium import webdriver
    from import By
    from import WebDriverWait
    from import expected_conditions as ECfrom         import Options
    chrome_options = Options()

    #Open new browser window
    driver = webdriver.Chrome(options=chrome_options)

    #Browser goes to auth_url

    #Sets up waiting until the second url to copy the new url
    wait = WebDriverWait(driver, 170)
    url = driver.current_url

    #closes window

Should I consider deploying a different way?

Hey @amaliajn,

Thanks for sharing your question!

Here are three examples of running Selenium on Streamlit Community Cloud:

  1. @snehankekre’s example:
  1. @Franky1’s example:
  1. @randyzwitch’s example:
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.