Want to automate Chrome or Chromium with ease?Puppeteer is a Node.js library that simplifies browser automation, perfect for tasks like testing and scraping. Here's what you'll learn:
Direct integration on Latenode: Learn how Latenode enhances web scraping workflows with a direct integration with Puppeteer-based Headless Browser and automation-friendly features. No need to pre-configure anything, just add the node and use in workflow automation!
Setup Requirements: Use Node.js 18+ and ensure your system meets the OS-specific dependencies.
Installation Options: Install Puppeteer with npm i puppeteer (includes Chrome for Testing) or npm i puppeteer-core (use your own browser).
Advanced Configurations: Optimize performance, set up proxies, and manage environment variables.
Before we share a complete guide on issues in configuring Puppeteer, you should know that you can just skip it and use a direct, ready-made integration node on Latenode! Check it out:
Skip Configuring Puppeteer: Use Our Ready-Made Integration onLatenode
Latenode works seamlessly with Puppeteer to simplify browser automation. Below, we’ll explore Latenode's features and how to use a direct integration with Puppeteer for your automation needs.
Here’s a breakdown of Latenode’s main features:
Feature
Description
Benefit
Headless Browser
Puppeteer library integration
Direct browser control
AI Code Assistant
Automated code generation
Speeds up debugging and coding
No-code flexibility
300+ no-code integrations for tailored workflow adjustments
Extends Puppeteer functionality
NPM Package Support
Access to over 1 million packages
Boosts automation capabilities
"What I liked most about Latenode compared to the competition is that I did have the ability to write code and create custom nodes." - Germaine H., Founder Information Technology [3]
Latenode offers integration with the Headless Browser node, which is based on Puppeteer and allows you to add code directly into the editor and use it for tasks such as scraping all available information from a website, taking screenshots of pages, filling out forms, and generally anything that Puppeteer supports.
To find this integration, simply navigate to the Code Integrations folder in the node library, where you'll find the Headless Browser node. Add it to your script, click on it, and an editor will open where you can add code of any complexity and length. Additionally, you can specify the address, login, and password of your Proxy in the settings.
Connecting Puppeteer-Based Headless Browser to Other Integrations
But one node is not enough for automation. For greater customization, add a trigger and another action. For example, a webhook trigger and response to monitor exchange rate changes at the Bank of England, as we show in the guide above. Here's a scenario:
SCENARIO
Why Choose Latenode Integration Over VPS-Based Solution?
"Latenode blows away the competition with 99% uptime, affordable execution-based pricing, and a user-friendly interface." - Hammad Hafeez [3]
Latenode’s pricing is based on execution time rather than individual tasks, making it a budget-friendly option for large-scale Puppeteer automation. This platform allows developers to focus on creating robust workflows without worrying about excessive costs.
To maximize efficiency, you can use Latenode's интеграцию с Javascript, а также более чем 300 интеграциями с базами данных, CRM, project management tools, and AI models like Claude, ChatGPT, and Gemini. There’s a lot of potential usecases: automated outreach, database management, web scraping, etc. By combining Latenode and Puppeteer, you can centralize and streamline your automation processes.
sbb-itb-23997f1
If you still want a guide on fixing Puppeteer problems, check out the breakdown below.
Failed to Launch Chromium on VPS? Install missing dependencies on VPS puppetter
Before You Start
Before installing Puppeteer, make sure your setup meets the necessary dependencies to ensure smooth installation and operation.
Puppeteer requires Node.js to run. The latest versions of Puppeteer work with Node.js version 18 or higher, which aligns with the current LTS release.
To check your Node.js version, use this command:
node --version
If your version is below 18, update Node.js before continuing. Using the latest LTS version is strongly recommended. After confirming your Node.js version, check your system's operating system requirements.
System Requirements
The system requirements for Puppeteer depend on the operating system you're using. Here's a quick overview:
Operating System
Architecture
Required Components
Approx. Download Size
Windows
x64
Chrome for Testing
~280MB
macOS
x64, arm64
Chrome for Testing
~170MB
Debian/Ubuntu
x64
Chrome for Testing + Libraries
~282MB
When installing Puppeteer, it will automatically download a compatible version of Chrome for Testing. The download size varies depending on your OS (~280MB for Windows, ~170MB for macOS, and ~282MB for Debian/Ubuntu Linux) [1].
For Linux users, particularly on Debian/Ubuntu, you’ll need to install some additional libraries. Use the following command:
Here are some extra tips for specific environments:
AWS EC2 Amazon Linux: Enable the EPEL repository and install Chromium before setting up Puppeteer.
Docker Environments: Add the required shared libraries and Chromium package to your Dockerfile.
TypeScriptProjects: Use TypeScript version 4.7.4 or higher to access Puppeteer’s latest type definitions and improve IDE support.
Basic Installation Steps
Once you've confirmed your Node.js setup and system requirements, you can install Puppeteer using npm.
npm Installation Guide
You have two ways to install Puppeteer through npm:
Standard Installation: This option automatically downloads Chrome for Testing:
npm i puppeteer
Core Installation: Use this if you want to manage browsers separately and skip downloading Chrome for Testing:
npm i puppeteer-core
With the standard installation, Chrome for Testing and the chrome-headless-shell binary are downloaded to $HOME/.cache/puppeteer. Check the System Requirements section for details on download sizes.
Once installed, you're ready to test your setup.
Testing Your Setup
Start by creating a file named test.js and add the following script:
If the script runs successfully and displays the page title, your installation is working correctly.
Troubleshooting Tips
Linux users: Use your package manager to ensure all required dependencies are installed.
Windows users: Verify that Chrome's sandbox permissions are correctly configured.
If Chrome isn't found in its default location, set the PUPPETEER_CACHE_DIR environment variable to point to the correct installation directory.
"Running without a sandbox is strongly discouraged. Consider configuring a sandbox instead." [2]
For better stability and easier maintenance, you can create a .puppeteerrc.cjs file to configure Puppeteer's behavior instead of passing arguments directly to the launch method.
Fixing Chromium Issues
Chromium problems often stem from missing libraries or incorrect settings.
Using Local Chromium
If you'd rather use an existing Chromium installation instead of downloading a new one, Puppeteer can be set up to work with your local browser. This method is helpful if you need a specific Chromium version or handle browser installations manually.
To link Puppeteer with your local Chromium, adjust your launch settings like this:
Managing dependencies effectively is crucial to avoid launch failures and unpredictable behavior. This section covers resolving version conflicts and keeping packages updated to prevent runtime errors.
Fixing Package Conflicts
Package conflicts often lead to errors like "Cannot find module 'puppeteer-core/internal/...'" or Chrome launch issues. Here's how to address these problems:
// Example: Resolving version conflicts using package.json overrides
{
"overrides": {
"ws": "^8.17.1",
"debug": "^4.3.4"
}
}
Steps to troubleshoot:
Check Node.js Version: Make sure you're using Node.js 18 or higher. Older versions can lead to compatibility issues.
Verify System Libraries: On Linux, ensure all required system libraries are installed. Refer to the dependency list in the System Requirements section.
Review Chrome Policies: Chrome policies may conflict with Puppeteer's default --disable-extensions flag. Try launching without it:
Once your setup is verified, you can focus on improving your workflows for better automation results.
Getting Started Tips
Carriyo’s PDF system efficiently handled 10,000 shipment labels daily, achieving a p95 latency of 365ms [4]. To reach similar performance levels, consider these strategies:
Resource Management: Disable unnecessary features to save resources. For instance, launch Puppeteer with optimized settings:
Error Handling: Use robust error recovery methods, such as try-catch blocks and custom error handlers tailored to specific issues.
Performance Optimization: Boost speed by:
Caching frequently used data
Intercepting network requests
Running tasks in parallel
Using Chrome DevTools to monitor performance
For more advanced automation, explore Latenode’s low-code workflow platform. It offers execution-based pricing and a range of features to simplify complex Puppeteer implementations [3].