1.0.0 • Published 5 years ago

dom-element-screenshot-scraper v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

dom-element-screenshot-scraper

Module that use puppeteer to save a screenshot of html element on screen.

Installation

npm install dom-element-screenshot-scraper

Usage

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'
		}
  })

})()

Method domElementScreenshot ( options )

Promise => domElementScreenshot()

Options

options.url => Page url options. selector => CSS selector ('#my-id .my-class-element')