0


docker运行selenium-python3

环境:doker/selenium/standalone-chrome:89.0

试试https://github.com/SeleniumHQ/docker-selenium。在

它安装了python:

  1. $ docker run selenium/standalone-chrome python3 version
  2. Python 3.5.2

说明书上说你从

编辑:

为了让selenium在python中运行,需要安装下面的包。创建此

  1. Dockerfile

  1. FROM selenium/standalone-chrome
  2. USER root
  3. RUN apt-get install python3-distutils
  4. RUN wget https://bootstrap.pypa.io/get-pip.py
  5. RUN python3 get-pip.py
  6. RUN python3 -m pip install selenium

然后你可以用

  1. docker build . -t selenium-chrome && \
  2. docker run -it selenium-chrome python3

与普通的

  1. python

docker映像相比的优势是,您不需要安装chromedriver本身,因为它来自

  1. selenium/standalone-chrome

。在

标签: docker selenium 容器

本文转载自: https://blog.csdn.net/u011405698/article/details/131520242
版权归原作者 alvinToffler 所有, 如有侵权,请联系我们删除。

“docker运行selenium-python3”的评论:

还没有评论