Example Puppeteer

apify/example-puppeteer

Example showing how to use headless Chromium with Puppeteer to open a web page, determine its dimensions, save a screenshot and print the page to PDF. For more information about Puppeteer, please see https://github.com/GoogleChrome/puppeteer This act must use image with Puppeteer (Node.js 8 + Puppeteer on Debian).

Modified
Last run
Used 337 times

To run the actor, you'll need a free Apify account. Simply open the actor console by clicking the button below, modify the actor input configuration, click Run and get your results.

API

To run the actor from your code, send a HTTP POST request to the following API endpoint:

https://api.apify.com/v2/acts/apify~example-puppeteer/runs?token=<YOUR_API_TOKEN>

The POST payload including its Content-Type header is passed as INPUT to the actor (usually application/json). The actor is started with the default options; you can override them using various URL query parameters.

Example
curl https://api.apify.com/v2/acts/apify~example-puppeteer/runs?token=<YOUR_API_TOKEN> \
-d '{ "url": "http://wikipedia.com" }' \
-H 'Content-Type: application/json' \
-X POST

To use the API, you'll need to replace <YOUR_API_TOKEN> with the API token of your Apify account (view here).

For more information, view the list of actor API endpoints or the full API reference.

Scheduler

Do you need to run the actor periodically? You can easily create a schedule that will run the actor any time you want.