Status code was: 127

Question: how to download Chrome or another browser to use it as an emulator for web requests.

from import By
from selenium import webdriver
from import ChromeDriverManager
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome(executable_path=ChromeDriverManager().install())

assert 'Yahoo' in driver.title

elem = driver.find_element(By.NAME, 'p')  # Find the search box
elem.send_keys('seleniumhq' + Keys.RETURN)


Yahoo is just as an example.

[WDM] - Downloading: 100%|████| 6.83M/6.83M [00:00<00:00, 66.2MB/s] DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  driver = webdriver.Chrome(executable_path=ChromeDriverManager().install())
Traceback (most recent call last):
  File "", line 102, in <module>
    driver = webdriver.Chrome(executable_path=ChromeDriverManager().install())
  File "/home/runner/Web-request-01v/venv/lib/python3.10/site-packages/selenium/webdriver/chrome/", line 80, in __init__
  File "/home/runner/Web-request-01v/venv/lib/python3.10/site-packages/selenium/webdriver/chromium/", line 101, in __init__
  File "/home/runner/Web-request-01v/venv/lib/python3.10/site-packages/selenium/webdriver/common/", line 106, in start
  File "/home/runner/Web-request-01v/venv/lib/python3.10/site-packages/selenium/webdriver/common/", line 119, in assert_process_still_running
    raise WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service /home/runner/.wdm/drivers/chromedriver/linux64/111.0.5563/chromedriver unexpectedly exited. Status code was: 127

I googled and tried some ways to do it, however nothing helped.
I’m not saying that I did everything right, so I will appreciate your help.

I am not sure, but I dont think selenium is supported on Replit because selenium uses Google Chrome to do everything and as I know, Google Chrome isn’t installed in Repls.
You can instead try the requests and bs4 (BeautifulSoup4) modules, there is a lot of tutorials online like on the great GeeksForGeeks website.
Here is the code with requests and bs4 to get page title:

# Be sure to install packages `requests` and `bs4` !
import requests, bs4

# Set custom headers because some sites refuse access of some bots like this one
headers = {"User-Agent": "mozilla/5.0 (windows; u; windows nt 5.1) applewebkit/538.0.1 (khtml, like gecko) chrome/14.0.878.0 safari/538.0.1"}

# Send the request to the Yahoo site
r = requests.get("", headers=headers)

# Create a BeautifulSoup4 object
soup = bs4.BeautifulSoup(r.text, "html.parser")

# Prints the page title

Hope it helped !

1 Like

Add chromedriver via Nix: run in Shell:

sed -i 's/];/  pkgs.chromedriver\n  &/' replit.nix

Then, Ctrl\ in Console, then run your repl


Cool ! I did not knew that Nix (the OS that Replit uses) provides the Chrome Driver. Good to know !

BTW it seems that I missunderstanded what the code should do, so my answer isn’t a really good solution. This is because I never really used selenium or the Chrome driver.