Files
ArticleReplaceBatch/DEPLOY.md
2026-03-25 15:17:18 +08:00

60 lines
881 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 部署说明
## 问题背景
原代码使用 `webdriver-manager` 自动下载 chromedriver但存在以下问题
1. 驱动版本不匹配
2. 架构混淆32/64位
3. 文件损坏
## 解决方案
**打包预下载的驱动 together避免运行时动态下载**
### 1. 准备驱动
```bash
python setup_driver.py
```
```bash
install_driver.bat
```
### 2. 打包程序
```bash
build_for_delivery.bat
```
```bash
pyinstaller ArticleReplace_optimized.spec
```
### 3. 分发
打包后的程序位于 `dist/ArticleReplace/`,无需安装任何依赖。
## 技术细节
### get_web_content.py 的改进
1. 移除 webdriver-manager 依赖
2. 驱动路径查找顺序
3. 异常处理改进
## 文件清单
```
drivers/
├── chromedriver64.exe
└── chromedriver32.exe
setup_driver.py
install_driver.bat
build_for_delivery.bat
DEPLOY.md
```