# Puppeteer
# Overview
Puppeteer node by Kumologica integrates seamlessly with the puppeteer library. Puppeteer node can be used to take screenshots of a website page in one of the following formats.
- Image
# Setup
# Prerequisites
Not applicable
# Installation
To install the node from designer:
- Go to Add more nodes option on the palette section.
- Check for the Puppeteer node and click install.
- Once installed, the designer is required to be restarted.
To install the node from CLI:
- Go to your project workspace where you can see your
package.json
file. - Run the below give npm command.
npm i @kumologica/kumologica-contrib-puppeteer
# Technical Details
Properties
- End point URL (Required)
Website URL whose snapshot has to be taken. Provide the URL without https prefix, as the node adds this. - Output (Required)
Supports two output types, i.e Image (PNG format) or as PDF.
Supported Operations
Screenshot
Throws
Puppeteer node throws the following exception.
- PuppeteerError
Returns
On successful execution, the buffer output will be stored in payload. The buffer output can be accessed using msg.payload.[display name of the Puppeteer node].result
. Provide the display name by trimming the space. e.g : if the Display Name is amazon search
then the result can be accessed as msg.payload.amazonsearch.result
.
When using the Display Name with hyphen -
character in the node name (e.g amazon-search) then the result can be accessed as
msg.payload.'amazon-search'.result
# Develop a Service
Video tutorial
# Instructions
Drag a drop an EventListener node from the palette to the canvas. Open the settings, configure the following and Save.
Display Name : POST /snapshot Event Source : Amazon API gateway Verb : POST URL : /snapshot
From the Automation category add Puppeteer node to the canvas. Open the settings, configure the following and Save.
Display Name : google Endpoint URL : www.google.com Output : Image
Wire the EventListener node to the Puppeteer node.
Add EventListener End node from the palette to the canvas. Open the settings, configure the following and Save.
Payload : msg.payload.google.result
Wire the Puppeteer node to EventListener.
# Try it
← PagerDuty Playwright →