News for hackers. Stuff that matters.
Re:Puppeteer: Headless Chrome Node API by borplk on Wednesday August 16, 2017 @02:59PM (#15030144)
Does anyone know if it's possible to take a screenshot of a specific DOM element? (instead of the entire page)
Re:Puppeteer: Headless Chrome Node API by paulirish on Wednesday August 16, 2017 @03:58PM (#15030745)
Yes using the `clip` option of screenshot(), you can get these dimensions from an element's getBoundingClientRect().
Re:Puppeteer: Headless Chrome Node API by ebidel on Wednesday August 16, 2017 @08:44PM (#15032693)
full example of screenshoting a DOM element:

https://github.com/GoogleChrome/puppeteer/issues/306#issueco...

Re:Puppeteer: Headless Chrome Node API by borplk on Wednesday August 16, 2017 @11:02PM (#15033471)
Thank you. That's perfect.
Re:Puppeteer: Headless Chrome Node API by Garbee on Wednesday August 16, 2017 @03:52PM (#15030675)
Currently 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.
Re:Puppeteer: Headless Chrome Node API by O4epegb on Thursday August 17, 2017 @03:05AM (#15034402)
It is already supported, as Paul Irish said
Re:Puppeteer: Headless Chrome Node API by zo1 on Wednesday August 16, 2017 @04:36PM (#15031154)
Looks like the ChromeDevToolsProtocol (which this library uses) can, see the docs here:

https://chromedevtools.github.io/devtools-protocol/tot/Page/...