环境:doker/selenium/standalone-chrome:89.0
试试https://github.com/SeleniumHQ/docker-selenium。在
它安装了python:
$ docker run selenium/standalone-chrome python3 version
Python 3.5.2
说明书上说你从
编辑:
为了让selenium在python中运行,需要安装下面的包。创建此Dockerfile
:
FROM selenium/standalone-chrome
USER root
RUN apt-get install python3-distutils
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
RUN python3 -m pip install selenium
然后你可以用文章来源:https://www.toymoban.com/news/detail-668077.html
docker build . -t selenium-chrome && \
docker run -it selenium-chrome python3
与普通的python
docker映像相比的优势是,您不需要安装chromedriver本身,因为它来自selenium/standalone-chrome
。在文章来源地址https://www.toymoban.com/news/detail-668077.html
到了这里,关于docker运行selenium-python3的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!