Need advice about which tool to choose?Ask the StackShare community!

jsdom

447
42
+ 1
0
Puppeteer

380
501
+ 1
25
Add tool

Puppeteer vs jsdom: 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, jsdom is detailed as "A JavaScript implementation of the WHATWG DOM and HTML standards, for use with node.js". It is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a web browser to be useful for testing and scraping real-world web applications.

Puppeteer and jsdom can be categorized as "Headless Browsers" tools.

Puppeteer and jsdom are both open source tools. Puppeteer with 53.9K GitHub stars and 5.09K forks on GitHub appears to be more popular than jsdom with 12.9K GitHub stars and 1.16K GitHub forks.

Advice on jsdom and Puppeteer
Ankur Loriya
Needs advice
on
PuppeteerPuppeteer
and
PhantomJSPhantomJS

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?

See more
Replies (2)
Recommends
PuppeteerPuppeteer

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.

See more
Recommends
PuppeteerPuppeteer

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.

See more
Get Advice from developers at your company using Private StackShare. Sign up for Private StackShare.
Learn More
Pros of jsdom
Pros of Puppeteer
    Be the first to leave a pro
    • 10
      Scriptable web browser
    • 9
      Very well documented
    • 6
      Promise based

    Sign up to add or upvote prosMake informed product decisions

    Cons of jsdom
    Cons of Puppeteer
      Be the first to leave a con
      • 10
        Chrome only

      Sign up to add or upvote consMake informed product decisions

      - No public GitHub repository available -

      What is jsdom?

      It is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a web browser to be useful for testing and scraping real-world web applications.

      What is Puppeteer?

      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.

      Need advice about which tool to choose?Ask the StackShare community!

      What companies use jsdom?
      What companies use Puppeteer?
      See which teams inside your own company are using jsdom or Puppeteer.
      Sign up for Private StackShareLearn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with jsdom?
      What tools integrate with Puppeteer?

      Blog Posts

      What are some alternatives to jsdom and Puppeteer?
      Selenium
      Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
      PhantomJS
      PhantomJS is a headless WebKit scriptable with JavaScript. It is used by hundreds of developers and dozens of organizations for web-related development workflow.
      Enzyme
      Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
      Domino
      Use our cloud-hosted infrastructure to securely run your code on powerful hardware with a single command — without any changes to your code. If you have your own infrastructure, our Enterprise offering provides powerful, easy-to-use cluster management functionality behind your firewall.
      Playwright
      It is a Node library to automate the Chromium, WebKit and Firefox browsers with a single API. It enables cross-browser web automation that is ever-green, capable, reliable and fast.
      See all alternatives