2024-07-22 14:36:56 +00:00
|
|
|
|
## 项目说明
|
|
|
|
|
|
|
|
|
|
定制项目,定时获取网站中指定信息,提取关键数据,显示出来
|
|
|
|
|
|
|
|
|
|
支持数据导出为Excel,页面打印为PDF
|
|
|
|
|
|
|
|
|
|
通讯:WebSocket
|
|
|
|
|
|
|
|
|
|
自动化:selenium xpath
|
|
|
|
|
|
|
|
|
|
前端:HTML+CSS+JavaScript
|
|
|
|
|
|
|
|
|
|
## 配置模板
|
|
|
|
|
|
|
|
|
|
关于配置文件,请见:https://git.mllt.cc/MengLangStudio/selenium_elm_fengshen/wiki/?action=_pages
|
|
|
|
|
|
2024-07-22 13:45:14 +00:00
|
|
|
|
## 依赖安装
|
|
|
|
|
pip install flask-socketio eventlet
|
|
|
|
|
pip install eventlet
|
2024-07-22 07:21:36 +00:00
|
|
|
|
pip install pipreqs
|
2024-07-22 14:36:56 +00:00
|
|
|
|
pipreqs ./ --force
|
2024-07-22 07:21:36 +00:00
|
|
|
|
|
2024-07-22 13:45:14 +00:00
|
|
|
|
## 驱动手动下载
|
2024-07-22 07:21:36 +00:00
|
|
|
|
|
2024-07-22 13:45:14 +00:00
|
|
|
|
### 谷歌浏览器驱动
|
2024-07-22 07:21:36 +00:00
|
|
|
|
查看当前谷歌浏览器版本 chrome://version/
|
|
|
|
|
谷歌驱动
|
|
|
|
|
https://googlechromelabs.github.io/chrome-for-testing/
|
2024-07-22 13:45:14 +00:00
|
|
|
|
|
|
|
|
|
## 软件打包
|
|
|
|
|
|
|
|
|
|
### 打包后端
|
|
|
|
|
|
|
|
|
|
pyinstaller --onefile run_window_v4.py -n "客户端"
|
|
|
|
|
|
|
|
|
|
### 打包前端
|
|
|
|
|
> 不建议打包,建议以服务的方式运行
|
|
|
|
|
|
|
|
|
|
找到Pyinstaller所在路径,打开,然后进入hooks文件夹 ,创建hook-dnspython.py,里面填写
|
|
|
|
|
```python
|
|
|
|
|
|
|
|
|
|
from PyInstaller.utils.hooks import collect_submodules
|
|
|
|
|
hiddenimports = collect_submodules('dns')
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
还不行的话再创建一个hook-dns.py
|
|
|
|
|
```python
|
|
|
|
|
|
|
|
|
|
from PyInstaller.utils.hooks import collect_submodules
|
|
|
|
|
hiddenimports = collect_submodules('dns')
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后cmd执行
|
|
|
|
|
|
2024-07-22 14:36:56 +00:00
|
|
|
|
```
|
|
|
|
|
pyinstaller -F flask_websoket.py -n "web" --add-data 'templates:templates' --add-data 'static:static' --hidden-import=eventlet.hubs.epolls --hidden-import=eventlet.hubs.kqueue --hidden-import=eventlet.hubs.selects --hidden-import=engineio.async_drivers.threading
|
|
|
|
|
```
|
|
|
|
|
|