# Puppeteer

Category: Automation
|
Runtime: 0.9+
|
Available: Free

# 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
  • PDF

# Setup

# Prerequisites

Not applicable

# Installation

To install the node from designer:

  1. Go to Add more nodes option on the palette section.
  2. Check for the Puppeteer node and click install.
  3. Once installed, the designer is required to be restarted.

To install the node from CLI:

  1. Go to your project workspace where you can see your package.json file.
  2. 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

  1. 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
    
  2. 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
    
  3. Wire the EventListener node to the Puppeteer node.

  4. Add EventListener End node from the palette to the canvas. Open the settings, configure the following and Save.

    Payload : msg.payload.google.result
    
  5. Wire the Puppeteer node to EventListener.

# Try it

Sample Flow with Puppeteer node