Best Open Source Javascript Web Scraping Tools and Frameworks in 2020

Javascript is a widely-used programming language and an ever-increasing number of websites use JavaScript to fetch and render user content. While there are various tools available for web scraping, a growing number of people are exploring Javascript web scraping tools.

To carry out your web scraping projects, you need to familiarize yourself with web scraping tools to choose the right one. We will walk through open source Javascript tools and frameworks that are great for web crawling, web scraping, parsing, and extracting data.

Open Source Javascript Web Scraping Tools and Frameworks

Features/Tools Github Stars Github Forks Github Open Issues Last Updated Documentation License
Apify SDK 22K 1.4K 216 June 2020 Excellent MIT
NodeCrawler 5.4K 828 23 Nov 2015 Good MIT
Puppeteer 62K 6.4K 1,039 June 2020 Excellent Apache License 2.0
Playwright 13.3K 402 115 May 2020 Good Apache License 2.0
Node SimpleCrawler 2K 344 51 April 2020 Good BSD 2-Clause
PJScrape 1K 175 28 Oct 2011 Poor MIT
Cheerio 22K 1.4K 216 April 2020 Good MIT

Note: All details in the table above are current at the time of writing this article.

Apify SDK

apify-sdk-logo

Apify SDK is a Node.js library which is a lot like Scrapy positioning itself as a universal web scraping library in JavaScript, with support for Puppeteer, Cheerio, and more. With its unique features like RequestQueue and AutoscaledPool, you can start with several URLs and then recursively follow links to other pages and can run the scraping tasks at the maximum capacity of the system respectively.

Requirements – The Apify SDK requires Node.js 10.17 or later
Available Selectors – CSS
Available Data Formats – JSON, JSONL, CSV, XML, Excel or HTML

Pros

  • Supports any type of website
  • Best library for web crawling in Javascript we have tried so far.
  • Built-in support for Puppeteer and Cheerio

Installation
Add Apify SDK to any Node.js project by running:

npm install apify --save

Best Use Case

Apify SDK is a preferred tool when other solutions fall flat during heavier tasks – performing deep crawls, rotating proxies to mask the browser, scheduling the scraper to run multiple times, caching results to prevent data prevention if the code happens to crash, and more. Apify handles such operations with ease but it can also help to develop web scrapers of your own in Javascript.

 

Node SimpleCrawler

Simplecrawler is designed to provide a basic, flexible, and robust API for crawling websites. It was written to archive, analyze, and search some very large websites and can get through hundreds of thousands of pages and write large volumes of data without issue. It has a lot of useful events that can help you track the progress of your crawling process. This crawler is extremely configurable and there’s a long list of settings you can change to adapt it to your specific needs.

Requirements – Node.js 8.0+

Pros

  • Respects robot.txt rules
  • Highly configurable
  • Easy setup and installation

Cons

  • Does not download the response body when it encounters an HTTP error status in the response
  • No promise support
  • May get invalid URLs because of its brute force approach

Installation
To install simplecrawler type the command:

npm install --save simplecrawler

Best Use Case

If you need to start off with a flexible and configurable base for writing your own crawler

NodeCrawlernodecrawler-web-scraping-framework

Nodecrawler is a popular web crawler for NodeJS, making it a very fast crawling solution. If you prefer coding in JavaScript, or you are dealing with mostly a Javascript project, Nodecrawler will be the most suitable web crawler to use. Its installation is pretty simple too. JSDOM and Cheerio (used for HTML parsing) use it for server-side rendering, with JSDOM being more robust.

Requires Version – Node v4.0.0 or greater
Available Selectors – CSS, XPath
Available Data Formats – CSV, JSON, XML

Pros

  • Easy installation

Cons

  • It has no Promise support

Installation
To install this package with npm:

npm install crawler

Best Use Case

If you need a lightweight web crawler that combines efficiency and convenience.

 

PJScrape

PJscrape is a web scraping framework written in Python using Javascript and JQuery. It is built to run with PhantomJS, so it allows you to scrape pages in a fully rendered, Javascript-enabled context from the command line, with no browser required. The scraper functions are evaluated in a full browser context. This means you not only have access to the DOM, but you also have access to Javascript variables and functions, AJAX-loaded content, etc.

Requires Version – Node v4.0.0+, PhantomJS v.1.3+
Available Selectors – CSS
Available Data Format – JSON

Pros

  • Easy installation and setup for more than one scraper
  • Suitable for recursive crawling

Cons

  • Poor documentation

Installation
To install this package with npm:

bower install pjscrape

Best Use Case

If you need a web scraping tool in Javascript and JQuery

 

Puppeteerpuppeteer-web-scraping-framework

Puppeteer is a Node library which provides a powerful but simple API that allows you to control Google’s headless Chrome browser. A headless browser means you have a browser that can send and receive requests but has no GUI. It works in the background, performing actions as instructed by an API. You can truly simulate the user experience, typing where they type and clicking where they click.

A headless browser is a great tool for automated testing and server environments where you don’t need a visible UI shell. For example, you may want to run some tests against a real web page, create a PDF of it, or just inspect how the browser renders a URL. Puppeteer can also be used to take screenshots of web pages visible by default when you open a web browser.

Puppeteer’s API is very similar to Selenium WebDriver, but works only with Google Chrome. Puppeteer has a more active support than Selenium, so if you are working with Chrome, Puppeteer is your best option for web scraping.

Requires Version – Node v6.4.0, Node v7.6.0 or greater
Available Selectors – CSS
Available Data Formats – JSON

Pros

  • With its full-featured API, it covers a majority of use cases
  • The best option for scraping Javascript websites on Chrome

Cons

  • Only available for Chrome/Chromium browser
  • Supports only JSON format

Installation
To install Puppeteer in your project run:

npm i puppeteer

This will install Puppeteer and download the recent version of Chromium browser to run the puppeteer code. By default, puppeteer works with the Chromium browser but you can also use Chrome. You can also use the lightweight version of Puppeteer – puppeteer core. To install type the command:

npm i puppeteer core

Best Use Case

  • If you need to test the speed, performance, responsivenes, and UI of a website.
  • If you are using Chrome, Puppeteer is your best option for web scraping.
  • If the information you want is generated using

Playwright

Playwright is a Node library to automate multiple browsers with a single API. It enables cross-browser web automation that is ever-green, capable, reliable, and fast. Playwright was created to improve automated UI testing by eliminating flakiness, improving the speed of execution, and offering insights into the browser operation.

Playwright is very similar to Puppeteer in many respects. The API methods are identical in most cases, and Playwright also bundles compatible browsers by default. Playwright’s biggest differentiating point is cross-browser support. It can drive Chromium, WebKit, MS Edge, and Firefox.

A noteworthy difference is that Playwright has a more powerful browser context feature than Puppeteer. This lets you simulate multiple devices with a single browser instance.

Requires Version – Node.js 10.15 or above.
Available Selectors – CSS
Available Data Formats – JSON

Pros

  • Cross Browser support
  • Detailed documentation

Con

  • They have only patched the WebKit and Firefox debugging protocols, not the actual rendering engine

Installation
To install the package:

npm i -D playwright

This installs Playwright and browser binaries for Chromium, Firefox, and WebKit. Once installed, you can use Playwright in a Node.js script and automate web browser interactions.

Best use case

If you need an efficient tool as good as Puppeteer to perform UI testing but across multiple browsers, you should use Playwright.

Cheerio

Cheerio is a library that parses raw HTML and XML documents and allows you to use the syntax of jQuery while working with the downloaded data. With Cheerio, you can write filter functions to fine-tune which data you want from your selectors. If you are writing a web scraper in JavaScript, Cheerio API is a fast option that makes parsing, manipulating, and rendering efficient.

It does not – interpret the result as a web browser, produce a visual rendering, apply CSS, load external resources, or execute JavaScript. If you require any of these features, you should consider projects like PhantomJS or JSDom.

Requirements – Up to date versions of Node.js and npm
Available Selectors – CSS

Pros

  • Parsing, rendering and manipulating documents is very efficient
  • Flexible, Easy to Use
  • Very fast (Preliminary end to end benchmarks suggests its 8x faster than JSDOM)

Cons

  • Does not fare well for dynamic Javascript websites

Installation
To install the required modules using NPM, simply type the following command:

npm install cheerio

Best Use Case

If you need speed, go for Cheerio.


These are just some of the open-source javascript web scraping tools and frameworks you can use for your web scraping projects. If you have greater scraping requirements or would like to scrape on a much larger scale it’s better to use web scraping services.

If you aren’t proficient with programming or your needs are complex, or you need large volumes of data to be scraped, there are great web scraping services that will suit your requirements to make the job easier for you.

You can save time and get clean, structured data by trying us out instead – we are a full-service provider that doesn’t require the use of any tools and all you get is clean data without any hassles.

We can help with your data or automation needs

Turn the Internet into meaningful, structured and usable data



Please DO NOT contact us for any help with our Tutorials and Code using this form or by calling us, instead please add a comment to the bottom of the tutorial page for help

Posted in:   Tools and Services

Comments or Questions?

Turn the Internet into meaningful, structured and usable data   

ScrapeHero Logo

Can we help you get some data?