Puppeteer Knowledgebase

To handle modal popups like cookie consents in Puppeteer the popup can be closed through a button click or removed entirely. Here's how.

To click on a popup dialog in Puppeteer the dialog even can be captured and interacted with using page.on("dialog") method. Here's how to do it.

To scrape to the very bottom of the page with Puppeteer the javascript evaluation feature can be used within a while loop. Here's how.

Puppeteer-stealth is a popular plugin for Puppeteer browser automation library. It patches browsers to be less detectible. Here's how to get started.

To capture background requests and response in Puppeteer we can use page.on() method to intercept every request/response. Here's how.

To load local files in Puppeteer the file:// URL protocol can be used. Here's how to do it.

To save and load cookies in Puppeteer page.setCookies() and page.cookies() methods can be used. Here's how to do it.

To find HTML elements using CSS selectors in Puppeteer the $ and $eval methods can be used. Here's how to use them.

To find elements by XPath using Puppeteer the $x() method can be used. Here's how to use it.

To retreive page source in Puppteer the page.content() method can be used. Here's how to use it and what are the possible options.

To take a page or HTML element screenshot using Puppeteer the page.screenshot() method can be used. Here's how and what are the possible options.

To wait for a page to load in Puppeteer the best approach is to wait for a specific element to appear using page.waitForSelector() method. Here's how to do it.

Blocking non-critical resources in Puppeteer can drastically speed up the program. Here's how to do in Puppeteer and Nodejs.

To download a file using Puppeteer and NodeJS we can either simulate the click on the download button or use HTTP client. Here's how to do it.

Related

Provided by Scrapfly

This knowledgebase is provided by Scrapfly — a web scraping API that allows you to scrape any website without getting blocked and implements a dozens of other web scraping conveniences. Check us out 👇

Related Blog Posts

How to Scrape With Headless Firefox
How to Scrape With Headless Firefox

Discover how to use headless Firefox with Selenium, Playwright, and Puppeteer for web scraping, including practical examples for each library.

How to Use Chrome Extensions with Playwright, Puppeteer and Selenium
How to Use Chrome Extensions with Playwright, Puppeteer and Selenium

In this article, we'll explore different useful Chrome extensions for web scraping. We'll also explain how to install Chrome extensions with various headless browser libraries, such as Selenium, Playwright and Puppeteer.

How to Web Scrape with Puppeteer and NodeJS in 2024
How to Web Scrape with Puppeteer and NodeJS in 2024

Introduction to using Puppeteer in Nodejs for web scraping dynamic web pages and web apps. Tips and tricks, best practices and example project.

How to Scrape Dynamic Websites Using Headless Web Browsers
How to Scrape Dynamic Websites Using Headless Web Browsers

Introduction to using web automation tools such as Puppeteer, Playwright, Selenium and ScrapFly to render dynamic websites for web scraping