Need advice about which tool to choose?Ask the StackShare community!
Puppeteer vs Serverless Chrome: What are the differences?
Developers describe Puppeteer as "Headless Chrome Node API". Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome. On the other hand, Serverless Chrome is detailed as "Headless Chrome on AWS Lambda". The aim of this project is to provide the scaffolding for using Headless Chrome during a serverless function invocation. Serverless Chrome takes care of building and bundling the Chrome binaries and making sure Chrome is running when your serverless function executes. In addition, this project also provides a few "example" handlers for common patterns (e.g. taking a screenshot of a page, printing to PDF, some scraping, etc.).
Puppeteer and Serverless Chrome belong to "Headless Browsers" category of the tech stack.
Puppeteer and Serverless Chrome are both open source tools. Puppeteer with 51.1K GitHub stars and 4.71K forks on GitHub appears to be more popular than Serverless Chrome with 1.95K GitHub stars and 192 GitHub forks.
I am using Node 12 for server scripting and have a function to generate PDF and send it to a browser. Currently, we are using PhantomJS to generate a PDF. Some web post shows that we can achieve PDF generation using Puppeteer. I was a bit confused. Should we move to puppeteerJS? Which one is better with NodeJS for generating PDF?
You better go with puppeteer. It is basically chrome automation tool, written in nodejs. So what you get is PDF, generated by chrome itself. I guess there is hardly better PDF generation tool for the web. Phantomjs is already more or less outdated as technology. It uses some old webkit port that's quite behind in terms of standards and features. It can be replaced with puppeteer for every single task.
I suggest puppeteer to go for. It is simple and easy to set up. Only limitaiton is it can be used only for chrome browser and currently they are looking into expanding into FF. The next thing is Playwright which is just a scale up of Puppeteer. It supports cross browsers.
Pros of Puppeteer
- Very well documented10
- Scriptable web browser10
- Promise based6
Pros of Serverless Chrome
Sign up to add or upvote prosMake informed product decisions
Cons of Puppeteer
- Chrome only10