

Can someone help me with it? is my dockerfile,

RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR RUN wget -q -continue -P $CHROMEDRIVER_DIR "$CHROMEDRIVER_VERSION/chromedriver_linu圆4.zip" # Set up Chromedriver Environment variables RUN apt-get install -y google-chrome-stable

# Update the package list and install chrome RUN echo "deb stable main" > /etc/apt//google.list If you see above, I have not pass any path instead it is just, driver = webdriver.Chrome() preceded by chromedriver_autoinstaller.install(), should help you past the issue.# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver # and if it doesn't exist, download it automatically, Example from selenium import webdriverĬhromedriver_autoinstaller.install() # Check if the current version of chromedriver exists Just type import chromedriver_autoinstaller in the module you want to use chromedriver. Installation pip install chromedriver-autoinstaller This installer supports Linux, MacOS and Windows operating systems. chromedriver-autoinstallerĪutomatically download and install chromedriver that supports the currently installed version of chrome. In Python-Selenium I wouldn't pass the chromedriver path, instead I will use auto installer, so that it won't fail in such cases. Python driver script driver = webdriver.Chrome(options=options, executable_path='/usr/local/bin/chromedriver') Please find the Dockerfile to install the Chromedriver and Chrome onto the image and the default path for the chromedriver within the container. I have found the problem, you need to add the all the python files into the Dockerfile. Would that be causing an issue?Īny assist would be much appreciated as I have been stuck on this for a long time. I am using a venv as I am also using flask to create a micro service that uses the chrome driver. Python code driver = webdriver.Chrome(options=options, executable_path='/usr/local/bin/chromedriver') It is in this directory '/usr/local/bin/chromedriver'. The chromedriver.exe file is in the container as I have found it in the CLI. Ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriverĮcho "deb stable main" > /etc/apt//google-chrome.list & \Īpt-get -yqq install google-chrome-stable & \ Unzip -qq /tmp/chromedriver_linu圆4.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION & \Ĭhmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver & \ Mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION & \Ĭurl -sS -o /tmp/chromedriver_linu圆4.zip $CHROMEDRIVER_VERSION/chromedriver_linu圆4.zip & \ RUN CHROMEDRIVER_VERSION=`curl -sS /LATEST_RELEASE` & \ It installs the latest versions of Google Chrome and the chrome driver. I have created a docker image with the Docker file below.
