郑重声明, 本文仅用作学习研究使用,请勿用作商业用途,遵守法律!!!

部署环境有些坑,踩一次就够了。。。

原项目地址

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 项目的更多相关文章

  1. 教你如何一步步将项目部署到Github

    注册Github账号有半年多的时间,却一直不知道如何将自己做好的项目部署到Github中.看了网上许多的教程,要么一开始就来Git命令行,要么直接就来一堆术语,很少能够真正说中要点,解决我们的烦恼. ...

  2. vue cli 3.x 项目部署到 github pages

    github pages 是 github 免费为用户提供的服务,写博客,或者部署一些纯静态项目. 最近将 vue cli 3.x 初始化项目部署到 github pages,踩了一些坑,记录如下. ...

  3. 将项目部署到github的方法

    GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub. GitHub于2008年4月10日正式上线,除了Git代码仓库托管及基本的 We ...

  4. jenkins部署github项目持续集成

    一.先介绍正向代理和反向代理 正向代理 反向代理 二.安装反响代理得到固定域名 http://www.xiaomiqiu.cn/ 三.Jenkins与Github集成 配置前要求: 1.Jenkins ...

  5. Jenkins:用maven在本地打包部署一个github的springboot项目(Jenkins 2.257)

    一,部署的准备工作 1,测试项目的地址: https://github.com/liuhongdi/profile 是一个空白项目 2,准备java环境:参见: https://www.cnblogs ...

  6. React项目打包并部署到 Github 展示预览效果

    React项目打包并部署到 Github 展示预览效果 当开发者模式结束,准备打包的时进行以下步骤: 在package.json配置文件中加一句: "homepage": &quo ...

  7. hexo博客部署到github无法上传的问题

    博客生成之后,按照网上别人的教程,讲项目部署到github上,修改_config.yaml中的deploy部分如下所示: deploy: type: git repository: https://g ...

  8. 将 Hexo 个人博客同时部署到 GitHub 和 Coding 上

    一.将个人博客托管到 GitHub 上 关于如何快速搭建自己的个人博客,如何完善自己的个人博客,什么是 GitHub ,如何将自己的博客代码托管到 GitHub 上面等等问题,我之前写过三篇文章已经做 ...

  9. 搭建Hexo博客并部署到Github

    参考: http://www.jianshu.com/p/a67792d93682 http://jingyan.baidu.com/article/d8072ac47aca0fec95cefd2d. ...

随机推荐

  1. 强大的unique

    强大的unique 两道红题为例眼熟一下unique P1138 第k小整数 题解 这里用到了STL的去重函数哦 unique 首先你有一个待处理的数组 a[n] 一定要先排序鸭  sort( a+1 ...

  2. router 配置按需加载对应的组件,配置active

    const routes = [ { path: '/', component: App, children: [ {path: '/index/:type', name: 'index', comp ...

  3. WCF的CommunicationObjectFaultedException异常问题

    前天刚刚重装了系统,装上了Win7,结果在调试的时候,WCF服务Open报错了! 具体错误信息如下: System.ServiceModel.CommunicationObjectFaultedExc ...

  4. Centos7.4 yum 安装MariaDB

    #系统及版本选择:https://downloads.mariadb.org/mariadb/repositories/#mirror=tunavim /etc/yum.repos.d/MariaDB ...

  5. iOS去除数组中重复的model数据

    // 去除数组中model重复 ; i < self.selectedModelArray.count; i++) { ;j < self.selectedModelArray.count ...

  6. IFC布局特点

    IFC(inline formatting context),行内格式化上下文 特点: 1.内联元素在水平线上一个接一个排列 2.内部元素水平方向上的margin.padding.border有效,垂 ...

  7. 【TypeScript】学习笔记 把一些需要记的记录一下

    安装typescript: npm install -g typescript 启动typesctipt自动编译: tsc 文件名.ts --watch 函数参数默认值: 1.有默认值参数的,声明在最 ...

  8. PJzhang:我发现一个有两个答案的数独题

    猫宁!!! 最近做数独题,发现了一个答案不唯一的数独,之前对此类数独有所耳闻,但是没有亲手发现,碰巧发现一个,很是欣喜.   下面展示了两个答案   第一个 ​​   第二个 ​​   绿色标签是答案 ...

  9. pandas中.value_counts()用于统计数据集中的某一列

    value_counts()是一种查看表格某列中有多少个不同值的快捷方法,并计算每个不同值有在该列中有多少重复值.value_counts()是Series拥有的方法,一般在DataFrame中使用时 ...

  10. 应用安全 - 工具 - Jmeter - 漏洞 - 汇总

    CVE-2018-1297 Date 类型 rmi 反序列化导致远程代码执行 影响范围