shot-scraper

CLI

Simon Willison 出品的网页截图命令行:可按 YAML 批量截图、录制演示视频、导出 PDF 与 HTML,也能在页面中执行 JavaScript 提取数据、输出无障碍树。基于 Playwright,首次需安装浏览器。

simonw/shot-scraper2.6k
在 GitHub 上查看
README

shot-scraper

PyPI Changelog Tests License discord

A CLI utility for taking screenshots of websites, recording video demos and scraping sites using JavaScript

For background on this project see shot-scraper: automated screenshots for documentation, built on Playwright.

Documentation

Get started with GitHub Actions

To get started without installing any software, use the shot-scraper-template template to create your own GitHub repository which takes screenshots of a page using shot-scraper. See Instantly create a GitHub repository to take screenshots of a web page for details.

Quick installation

You can install the shot-scraper CLI tool using pip:

pip install shot-scraper
# Now install the browser it needs:
shot-scraper install

Taking your first screenshot

You can take a screenshot of a web page like this:

shot-scraper https://datasette.io/

This will create a screenshot in a file called datasette-io.png.

Many more options are available, see Taking a screenshot for details.

Examples