小编Ben*_*nji的帖子

Docker 容器内的 Selenium 找不到 chromedriver

我需要将我的小 Flask 应用程序放入 Docker 容器中,该应用程序可以检查我公司的客户安装了哪种类型的 Google 标签。为此,我需要有 selenium-wire 。你提供一个网站,然后你会得到一个 json 返回,告诉你安装了哪些标签(有点像http://gachecker.com/)。现在它与 Flask 应用程序配合得很好。当我尝试将其放入 Docker 时出现问题,这是我的 docker 脚本:

FROM python:3.9 WORKDIR /bziiit_checker_app

RUN pip install flask flask_restful requests BeautifulSoup4 selenium-wire undetected-chromedriver chromedriver-py

COPY ./app ./app

CMD ["python", "./app/main.py"]
Run Code Online (Sandbox Code Playgroud)

Once it's in Docker and try to run it, i get that message

"selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH"
Run Code Online (Sandbox Code Playgroud)

Which is a common issue when the chromedriver.exe file is not in the working directory. But it IS. Do …

python selenium docker

4
推荐指数
1
解决办法
4085
查看次数

标签 统计

docker ×1

python ×1

selenium ×1