WebScreenshot
仓库
- GitHub: https://github.com/yiyungent/WebScreenshot
Introduce
ASP.NET Core + Selenium 实现 网页截图
Quick Start
方式1: 使用 Railway 免费部署
方式2: 使用 Heroku 免费部署
方式3: 使用 Docker
# 获取源代码: 方式1: ssh
git clone git@github.com:yiyungent/WebScreenshot.git
# 获取源代码: 方式2: https
git clone https://github.com/yiyungent/WebScreenshot.git
docker build -t yiyungent/webscreenshot -f src/WebScreenshot/Dockerfile .
docker run -d -p 5004:80 -e ASPNETCORE_URLS="http://*:80" --name webscreenshot yiyungent/webscreenshot
Demo
-
https://webscreenshot.up.railway.app/?url=https://moeci.com
-
https://webscreenshot.up.railway.app/?url=https://moeci.com&windowWidth=1280
- 浏览器窗口宽 1280, 高度自动延展
-
https://webscreenshot.up.railway.app/?url=https://www.antmoe.com/posts/21874bc7/&jsurl=https://gitee.com/yiyunLearnRepos/test/raw/master/www.antmoe.com/posts.js
- 注入 js, 修改页面
-
https://webscreenshot-yiyun.herokuapp.com/?url=https://www.google.com
-
https://webscreenshot-yiyun.herokuapp.com/?url=https://manga.bilibili.com/mc27189/367947?from=manga_detail&windowWidth=1280&forceWait=20
- 强制等待 20 秒
API 文档
- https://webscreenshot.up.railway.app/swagger
- https://webscreenshot-yiyun.herokuapp.com/swagger
环境变量
环境变量名称 | 必填 | 备注 |
---|---|---|
WEBSCREENSHOT_CACHEMINUTES | 截图 缓存时间 (分钟), 默认 60 | |
WEBSCREENSHOT_CACHEMODE | 缓存模式, 默认 memory, 可填 file |
相关项目
- yiyungent/Dragonfly
Donate
WebScreenshot is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.
We accept donations through these channels:
- 爱发电 (¥5.00 起)
- 面包多 (¥1.00 起)
Author
WebScreenshot © yiyun, Released under the MIT License.
Authored and maintained by yiyun with help from contributors (list).