docker部署python(selenium)项目

拉取镜像

docker pull python:3.8.2

启动容器,并已命令行模式进入容器

docker run -it python:3.8.2 /bin/bash

在容器中安装程序依赖

pip install python-telegram-bot # 告警

pip install openpyxl # 操作excel表格

pip install selenium==4.7.2 # selenium

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm #chrome 源

yum install -y google-chrome-stable_current_x86_64.rpm #chrome浏览器

google-chrome –version # 查看浏览器版本

google-chrome-stable –no-sandbox –headless –disable-gpu –screenshot https://www.baidu.com/ # 测试浏览器无界面模式


docker部署python(selenium)项目
https://moreylee.github.io/2023/01/30/docker部署python-selenium-项目/
作者
morey
发布于
2023年1月30日
许可协议