代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
#安装python调用相关的库文件
function update(){
sudo apt-get update
sudo apt-get upgrade -y
#pip升级更新
pip install --upgrade pip
#安装脚本调用库
pip install configparser
pip install selenium
pip install datetime
pip install chinese_calendar
return 0
}
#将谷歌浏览器驱动复制到/usr/bin目录下
function mv_chromedriver(){
cd "$dirPath"/config || exit
sudo cp chromedriver /usr/bin
return 0
}
#安装google浏览器
function chrome_install(){
#卸载原有的谷歌浏览器
dpkg --list | grep 'google-chrome-stable' \
&& sudo dpkg --purge google-chrome-stable
cd "$dirPath"/config || exit
sudo dpkg -i google-chrome-stable_current_amd64.deb
return 0
}
#清除多余的配置文件
function purge_file() {
cd "$dirPath"/config || exit
if cat ERPcookies.pickle;then
rm -rf ERPcookies.pickle
fi
if cat userInfo.pickle;then
rm -rf userInfo.pickle
fi
}
function main(){
dirPath=$( pwd )
update
mv_chromedriver
chrome_install
purge_file
/usr/bin/python3 "$dirPath"/main.py
exit 0
}
main
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。