Selenium / webdriver error

I’m trying to perform Python automation using Selenium, but this log message appears:

INFO:root:Iniciando a automação...

May 26 03:30:59 PMINFO:root:Automação deu erro

May 26 03:30:59 PMCaminho do Chromium: /opt/render/project/src/chrome-win64/chrome.exe

May 26 03:30:59 PMCaminho do ChromeDriver: /opt/render/project/src/chromedriver-win64/chromedriver.exe

May 26 03:30:59 PMMessage: 'chromedriver.exe' executable may have wrong permissions.

May 26 03:30:59 PM

May 26 03:30:59 PM

I’m using the Chrome driver, and the browser itself downloaded directly from the repository, running the code locally, it runs normally without errors, running the automation without problems.


There will always be differences between environments: development mode/Local, production mode/Render, etc. These differences need to be considered and configured as required for your own app in each environment.

It looks like you’re trying to use Windows binaries on Render, which uses Linux.

Installing Chrome/Chromium on Render Native Runtimes is covered in several community topics, e.g.

Hello, fortunately I managed to install Google in the render, and applied it to the python code to use those in the render, however this message was displayed in the log when trying to run the automation:

INFO:root:Iniciando a automação...

May 29 09:28:58 AMINFO:root:Automação deu erro

May 29 09:28:58 AMCaminho do Google Chrome: /opt/render/project/.render/chrome/opt/google/chrome/google-chrome

May 29 09:28:58 AMCaminho do ChromeDriver: /opt/render/project/.render/chromedriver/chromedriver

May 29 09:28:58 AMMessage: session not created: This version of ChromeDriver only supports Chrome version 114

May 29 09:28:58 AMCurrent browser version is 125.0.6422.112 with binary path /opt/render/project/.render/chrome/opt/google/chrome/google-chrome

May 29 09:28:58 AMStacktrace:

I tried to download version 114 of Chrome but I couldn’t.

#!/usr/bin/env bash
# exit on error
set -o errexit


# Install dpkg if not already installed
if ! command -v dpkg &> /dev/null
  apt-get update && apt-get install -y dpkg

# Download and install Google Chrome
if [[ ! -d $STORAGE_DIR/chrome ]]; then
  echo "...Downloading Chrome"
  mkdir -p $STORAGE_DIR/chrome
  cd $STORAGE_DIR/chrome
  wget -P ./
  dpkg -x ./google-chrome-stable_current_amd64.deb $STORAGE_DIR/chrome
  rm ./google-chrome-stable_current_amd64.deb
  cd $HOME/project/src # Make sure we return to where we were
  echo "...Using Chrome from cache"

# Download and install ChromeDriver
if [[ ! -d $STORAGE_DIR/chromedriver ]]; then
  echo "...Downloading ChromeDriver"
  mkdir -p $STORAGE_DIR/chromedriver
  cd $STORAGE_DIR/chromedriver
  cd $HOME/project/src # Make sure we return to where we were
  echo "...Using ChromeDriver from cache"

# Add Chrome and ChromeDriver's location to the PATH
export PATH="${PATH}:/opt/render/project/.render/chrome/opt/google/chrome"
export PATH="${PATH}:/opt/render/project/.render/chromedriver"

# add your own build commands...

        # Caminho do Google Chrome instalado pelo script
        caminho_chrome = "/opt/render/project/.render/chrome/opt/google/chrome/google-chrome"
        caminho_chromedriver = "/opt/render/project/.render/chromedriver/chromedriver"

        # Verificar se o caminho do Google Chrome existe
        if os.path.exists(caminho_chrome):
            print("Caminho do Google Chrome:", caminho_chrome)
            raise FileNotFoundError(f"Caminho do Google Chrome não encontrado: {caminho_chrome}")

        # Verificar se o caminho do ChromeDriver existe
        if os.path.exists(caminho_chromedriver):
            print("Caminho do ChromeDriver:", caminho_chromedriver)
            raise FileNotFoundError(f"Caminho do ChromeDriver não encontrado: {caminho_chromedriver}")

        # Configurar as opções do Chrome"Iniciando a automação...")

        options = Options()
        options.binary_location = caminho_chrome


        # Configurar o serviço do ChromeDriver
        service = Service(executable_path=caminho_chromedriver)

        # Iniciar o navegador Chrome usando o caminho do Chromium especificado
        navegador = webdriver.Chrome(service=service, options=options)

I downloaded the latest version of webdriver through Selenium, now it’s causing problems with xpath, little by little it’s progressing.

AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'