安装¶
使用 pip
安装此工具
pip install shot-scraper
此工具依赖于 Playwright,后者首先需要安装其专用的 Chromium 浏览器。
运行一次 shot-scraper install
来进行安装
shot-scraper install
输出如下
Downloading Playwright build of chromium v965416 - 117.2 Mb [====================] 100% 0.0s
Playwright build of chromium v965416 downloaded to /Users/simon/Library/Caches/ms-playwright/chromium-965416
Downloading Playwright build of ffmpeg v1007 - 1.1 Mb [====================] 100% 0.0s
Playwright build of ffmpeg v1007 downloaded to /Users/simon/Library/Caches/ms-playwright/ffmpeg-1007
如果你想使用其他浏览器,例如 Firefox,你也应该安装它们
shot-scraper install -b firefox
shot-scraper install --help
¶
shot-scraper install
命令的完整 --help
Usage: shot-scraper install [OPTIONS]
Install the Playwright browser needed by this tool.
Usage:
shot-scraper install
Or for browsers other than the Chromium default:
shot-scraper install -b firefox
Options:
-b, --browser [chromium|firefox|webkit|chrome|chrome-beta]
Which browser to install
--help Show this message and exit.