From 6d44c2c43b3f7ba1e5f6a39393dfefde43a27ce0 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 9 Mar 2022 11:49:17 -0800 Subject: [PATCH] Docs for selector in YAML, refs #8 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index cac4049..7904979 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,14 @@ Then run the tool like so: This will create two image files, `example.com.png` and `w3c.org.png`, containing screenshots of those two URLs. +To take a screenshot of just the area of a page defined by a CSS selector, add `selector` to the YAML block: + +```yaml +- output: bighead.png + url: https://simonwillison.net/ + selector: "#bighead" +``` + ## Development To contribute to this tool, first checkout the code. Then create a new virtual environment: