部署 12306 github 项目
郑重声明, 本文仅用作学习研究使用,请勿用作商业用途,遵守法律!!!
部署环境有些坑,踩一次就够了。。。
git clone 原项目以及 识别验证码的模型
如果遇到 无法解析的问题 ,则 yum update nss curl
git clone https://github.com/testerSunshine/12306model.git (我个人也有保存网盘)
git clone https://github.com/testerSunshine/12306.git
安装 requirements.txt
推荐 anaconda 进行包管理, conda create -n py36 然后 配置一下 环境变量 一顿 安装
/home/ml/anaconda3/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
可能会少一些 模块
pip install opencv-python
下载 chrome 以及 chrome driver
1、安装chrome
用下面的命令安装最新的 Google Chrome
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
也可以下载到本地再安装
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
安装必要的库
yum install mesa-libOSMesa-devel gnu-free-sans-fonts wqy-zenhei-fonts
还有其他的 谷歌浏览器问题
https://www.e-learn.cn/content/qita/2350043
2、安装 chromedriver
chrome官网 wget https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
淘宝源(推荐)wget http://npm.taobao.org/mirrors/chromedriver/2.41/chromedriver_linux64.zip
将下载的文件解压,放在如下位置
unzip chromedriver_linux64.zip
/usr/bin/chromedriver
给予执行权限
chmod +x /usr/bin/chromedriver
设置 chrome driver 参数信息
grep -r 'webdriver'
vim config/getCookie.py
options = Options()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--headless')
from selenium import webdriver
cookies = []
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('headless')
driver = webdriver.Chrome(chrome_options=options, executable_path=TickerConfig.CHROME_PATH)
driver.get("https://www.12306.cn/index/index.html")
其中
“–no-sandbox”参数是让Chrome在root权限下跑
“–headless”参数是不用打开图形界面
可以额外加这些参数获得更好体验
其中
“–no-sandbox”参数是让Chrome在root权限下跑
“–headless”参数是不用打开图形界面
可以额外加这些参数获得更好体验
options.add_argument('blink-settings=imagesEnabled=false')
options.add_argument('--disable-gpu')
同步时间 并 修改时区
sudo ntpdate -u 210.72.145.44
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
放置 预测模型文件
cp 12306models/xxx.h5 12306/
部署 12306 github 项目的更多相关文章
- 教你如何一步步将项目部署到Github
注册Github账号有半年多的时间,却一直不知道如何将自己做好的项目部署到Github中.看了网上许多的教程,要么一开始就来Git命令行,要么直接就来一堆术语,很少能够真正说中要点,解决我们的烦恼. ...
- vue cli 3.x 项目部署到 github pages
github pages 是 github 免费为用户提供的服务,写博客,或者部署一些纯静态项目. 最近将 vue cli 3.x 初始化项目部署到 github pages,踩了一些坑,记录如下. ...
- 将项目部署到github的方法
GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub. GitHub于2008年4月10日正式上线,除了Git代码仓库托管及基本的 We ...
- jenkins部署github项目持续集成
一.先介绍正向代理和反向代理 正向代理 反向代理 二.安装反响代理得到固定域名 http://www.xiaomiqiu.cn/ 三.Jenkins与Github集成 配置前要求: 1.Jenkins ...
- Jenkins:用maven在本地打包部署一个github的springboot项目(Jenkins 2.257)
一,部署的准备工作 1,测试项目的地址: https://github.com/liuhongdi/profile 是一个空白项目 2,准备java环境:参见: https://www.cnblogs ...
- React项目打包并部署到 Github 展示预览效果
React项目打包并部署到 Github 展示预览效果 当开发者模式结束,准备打包的时进行以下步骤: 在package.json配置文件中加一句: "homepage": &quo ...
- hexo博客部署到github无法上传的问题
博客生成之后,按照网上别人的教程,讲项目部署到github上,修改_config.yaml中的deploy部分如下所示: deploy: type: git repository: https://g ...
- 将 Hexo 个人博客同时部署到 GitHub 和 Coding 上
一.将个人博客托管到 GitHub 上 关于如何快速搭建自己的个人博客,如何完善自己的个人博客,什么是 GitHub ,如何将自己的博客代码托管到 GitHub 上面等等问题,我之前写过三篇文章已经做 ...
- 搭建Hexo博客并部署到Github
参考: http://www.jianshu.com/p/a67792d93682 http://jingyan.baidu.com/article/d8072ac47aca0fec95cefd2d. ...
随机推荐
- Mac 配置adb环境变量(为了开Appium)亲测
1.启动终端Terminal. 2.进入当前用户的home目录. 在命令行输入echo $HOME 3.创建.bash_profile文件. 命令行输入touch .bash_profile 4.打开 ...
- [drf]访问文档出现错误'AutoSchema' object has no attribute 'get_link'
报错 'AutoSchema' object has no attribute 'get_link' 解决 参考 REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': ...
- Get web site source code
public String getPageSource() { StringBuffer sb = new StringBuffer(); try { // 构建一URL对象 URL url = ne ...
- 堆的ptmalloc机制
ptmalloc下堆的分配和回收 ptmalloc内存分配 1) 获取分配区的锁,为了防止多个线程同时访问同一个分配区,在进行分配之前需要取得分配区域的锁.线程先查看线程私有实例中是否已经存在一个分配 ...
- linux配置信息收集
CPU型号:# cat /proc/cpuinfo |grep "model name"# cat /proc/cpuinfo | grep name | cut -f2 -d: ...
- axios在Vue中的简单应用(一)
1.安装axios: npm install --save axios vue-axios 2.安装qs: qs.stringify(data)可以解决data数据格式问题 npm install - ...
- ERROR】Unable to open underlying table which is differently defined or of non-MyISAM type or ...
Error: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn’t ...
- 服务间的通信 RestTemplate和Feign
1.RestTemplate Spring RestTemplate 是 Spring 提供的用于访问 Rest 服务的客户端,RestTemplate 提供了多种便捷访问远程Http服务的方法,能够 ...
- OpenGL_构建GLFW与第一个程序
参考教程:https://learnopengl-cn.github.io/ 这个教程已经给出了很详细的资料,当然我这里是对细节的展示(在Windows上). 首先,你需要准备 VS2017 : ht ...
- NOIp2018D1T1 积木大赛 【思维】
题目传送门 感觉不是很难,但是需要一些思考... 可以发现,贪心地向尽量大的区间添加,但是存在一些比较小的数,它们不需要再加了,就会从那个地方断成两个区间.所以刚开始想到的做法就是统计每一种数的数量, ...