The chromedriver version cannot be discovered

Getting “The chromedriver version cannot be discovered” error when i follow install chrome in render using
build command:
./render-build.sh && pip install -r requirements.txt
start command:
export PATH=“${PATH}:/opt/render/project/.render/chrome/opt/google/chrome” && uvicorn flipkart_app:app --host 0.0.0.0 --port $PORT

I am using selenium, fast api in my project

#flipkart_app.py

Set up Selenium Chrome driver

options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-extensions')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(options=options)
driver.set_page_load_timeout(90)


driver.get(url)

# Wait for the page to fully load (adjust the delay as needed)
driver.implicitly_wait(6)

# Get the page source after the JavaScript has rendered
html = driver.page_source
soup = BeautifulSoup(html, "html.parser")


if name == “main”:
uvicorn.run(app, host=“0.0.0.0”, port=8080)

Please help to fix error
raise SeleniumManagerException(f"Selenium Manager failed for: {command}.\n{result}{stderr}")

selenium.common.exceptions.SeleniumManagerException: Message: Selenium Manager failed for: /opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --output json.

The chromedriver version cannot be discovered

Hi there,

How are you including the Chromedriver in your service? For Python, the easiest way is to use this: https://pypi.org/project/webdriver-manager/. Note that you will also need to install Chorme if you are not already doing so.

Regards,

Keith
Render Support, UTC+10 :australia:

Hey I have installed chrome in render using this post link
ChromeDriver is assuming that Chrome has crashed - #7 by markpro?

My code is this

Set up Selenium Chrome driver

options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-extensions')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(options=options)
driver.set_page_load_timeout(90)

url = f"https://www.flipkart.com/search?q={search}&otracker=search&otracker1=search&marketplace=FLIPKART&as-show=on&as=off&page={page_num}"
driver.get(url)

# Wait for the page to fully load (adjust the delay as needed)
driver.implicitly_wait(6)

I am trying to host my fastapi project which involves web scraping

I am getting below error in log of render

raise err

File “/opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py”, line 40, in get_path

path = shutil.which(service.path) or SeleniumManager().driver_location(options)

File “/opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py”, line 91, in driver_location

result = self.run(args)

^^^^^^^^^^^^^^

File “/opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py”, line 112, in run

raise SeleniumManagerException(f"Selenium Manager failed for: {command}.\n{result}{stderr}")

selenium.common.exceptions.SeleniumManagerException: Message: Selenium Manager failed for: /opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --output json.

The chromedriver version cannot be discovered

Hi there,

I wasn’t sure about this, but it does look like Selenium’s version of Web Driver Manager is included in their package, so you shouldn’t need the package I suggested in my previous response. They both do the same thing.

Checking the output from the Selenium Manager on your current service it seems to work fine, though it is possible the output from opt/render/project/src/.venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --output json is what is expected.

Can you try updating Selenium to the latest version? If this doesn’t help, please open a ticket directly with us. I would like to share some specific details of the failure with you, but I don’t want to post them in a public forum.

Regards,

Keith
Render Support, UTC+10 :australia: