Learn how to take a website screenshot in code using two Browserless methods: the /screenshot REST API for a single POST-to-PNG flow, and Puppeteer on Browsers as a Service for full programmatic control. This video walks through a demo of each one and shows when to pick which.
What you'll learn:
1) Why page.screenshot returns blank images on modern websites
2) How to take a full-page screenshot with a single API call using /screenshot
3) How to render HTML directly into a screenshot without a URL
4) How to connect Puppeteer to Browserless BaaS and call page.screenshot
5) How to capture a single element on the page using a CSS selector
6) When to use the REST Screenshot API vs Puppeteer for your screenshot workflow
Additional Links:
Chapters:
00:00 How to take a website screenshot with Browserless (2 methods)
01:12 Why page.screenshot returns blank images on modern sites
02:08 Take a screenshot with the Browserless /screenshot API
03:33 Take a screenshot and clip the image
03:50 Take a screenshot from raw HTML
04:20 Screenshot with Puppeteer and page.screenshot using BaaS
05:27 Perform actions and then take a Screenshot
05:52 Screenshot a specific element with Puppeteer
06:05 When to use the Screenshot API vs Puppeteer
07:13 Screenshot API and Puppeteer recap
Tools used in the video: Puppeteer, Node.js, cURL, Browserless Screenshot REST API
#Puppeteer #Screenshot #API #WebAutomation #Browserless