更新系统
sudo apt update sudo apt upgrade -y
安装Python 3.8
sudo apt install -y software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install -y python3.8 python3.8-venv python3.8-dev
创建虚拟环境
python3.8 -m venv myenv source myenv/bin/activate
安装pip
sudo apt install -y python3-pip
安装Selenium
pip install selenium
安装Chrome浏览器
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb sudo apt-get install -f
安装ChromeDriver
wget https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_linux64.zip unzip chromedriver_linux64.zip sudo mv chromedriver /usr/local/bin/ sudo chmod +x /usr/local/bin/chromedriver
运行脚本
python3.8 guge.py
评论