3 ms·
Does anyone know if it's possible to take a screenshot of a specific DOM element? (instead of the entire page)
by borplk 9y ago
Does anyone know if it's possible to take a screenshot of a specific DOM element? (instead of the entire page)
- Garbee 9y agoCurrently only PDF printing of the entire page view-port is available. File an issue with your use-case so the team can assess whether or not to look into including that kind of behavior.
- O4epegb 9y agoIt is already supported, as Paul Irish said
- paulirish 9y agoYes using the `clip` option of screenshot(), you can get these dimensions from an element's getBoundingClientRect().
- zo1 9y agoLooks like the ChromeDevToolsProtocol (which this library uses) can, see the docs here: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot https://chromedevtools.github.io/devtools-protocol/tot/Page/...