Module that use puppeteer to save a screenshot of html element on screen.
npm install dom-element-screenshot-scraper
const domElementScreenshot = require('dom-element-screenshot-scraper')
;(async () => {
const _response = await domElementScreenshot({
url: 'https://www.google.com/',
selector: '#hplogo',
launchOptions: { headless: true, defaultViewport: { width: 1200, height: 575 } },
screenshotOptions: {
path: 'my-file-name.png'
}
})
})()
Promise => domElementScreenshot()
options.url => Page url options. selector => CSS selector ('#my-id .my-class-element')