Rainist / scene-stealer

An HTTP Interface to take a screenshot via puppeteer of a part of a website and send it to you via Slack
https://www.npmjs.com/package/scene-stealer
7 stars 1 forks source link

Element screenshot #2

Closed suntong closed 6 years ago

suntong commented 6 years ago

Puppeteer also provides capability to do screenshot for a specific element -- https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#elementhandlescreenshotoptions

Can scene-stealer currently do that? Hope it can someday soon. Thx.

ryuheechul commented 6 years ago

Yes, it provides the screenshot feature by using that specific feature. You can see the code here below https://github.com/Rainist/scene-stealer/blob/612ba9b30d805199ea3c18acb59a1976c5ed784d/src/stealer.js#L19-L25

and that's why you need to provide the selector for the element as a parameter like below https://github.com/Rainist/scene-stealer/blob/612ba9b30d805199ea3c18acb59a1976c5ed784d/examples/google-gcs-slack.js#L7

I will close the issue for now, but if you think it needs to be open again, feel free to