All Projects → yujiosaka → Headless Chrome Crawler

yujiosaka / Headless Chrome Crawler

Licence: mit
Distributed crawler powered by Headless Chrome

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to Headless Chrome Crawler

bots-zoo
No description or website provided.
Stars: ✭ 59 (-98.85%)
Mutual labels:  crawler, scraper, scraping, crawling, puppeteer
Webster
a reliable high-level web crawling & scraping framework for Node.js.
Stars: ✭ 364 (-92.9%)
Mutual labels:  crawler, crawling, puppeteer, chromium, headless-chrome
Squidwarc
Squidwarc is a high fidelity, user scriptable, archival crawler that uses Chrome or Chromium with or without a head
Stars: ✭ 125 (-97.56%)
Mutual labels:  crawler, crawling, chrome, puppeteer, headless-chrome
Linkedin Profile Scraper
🕵️‍♂️ LinkedIn profile scraper returning structured profile data in JSON. Works in 2020.
Stars: ✭ 171 (-96.67%)
Mutual labels:  crawler, scraper, scraping, crawling, puppeteer
Ferret
Declarative web scraping
Stars: ✭ 4,837 (-5.69%)
Mutual labels:  crawler, scraper, scraping, crawling, chrome
Crawly
Crawly, a high-level web crawling & scraping framework for Elixir.
Stars: ✭ 440 (-91.42%)
Mutual labels:  crawler, scraper, scraping, crawling
Phantomas
Headless Chromium-based web performance metrics collector and monitoring tool
Stars: ✭ 2,191 (-57.28%)
Mutual labels:  puppeteer, chromium, headless-chrome, jquery
Awesome Puppeteer
A curated list of awesome puppeteer resources.
Stars: ✭ 1,728 (-66.31%)
Mutual labels:  scraping, crawling, puppeteer, headless-chrome
Lulu
[Unmaintained] A simple and clean video/music/image downloader 👾
Stars: ✭ 789 (-84.62%)
Mutual labels:  crawler, scraper, scraping, crawling
Colly
Elegant Scraper and Crawler Framework for Golang
Stars: ✭ 15,535 (+202.89%)
Mutual labels:  crawler, scraper, scraping, crawling
Jvppeteer
Headless Chrome For Java (Java 爬虫)
Stars: ✭ 193 (-96.24%)
Mutual labels:  crawler, scraper, chrome, puppeteer
Apify Js
Apify SDK — The scalable web scraping and crawling library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.
Stars: ✭ 3,154 (-38.51%)
Mutual labels:  scraping, crawling, puppeteer, headless-chrome
diffbot-php-client
[Deprecated - Maintenance mode - use APIs directly please!] The official Diffbot client library
Stars: ✭ 53 (-98.97%)
Mutual labels:  scraper, scraping, crawling
LInkedIn-Reverese-Lookup
🔎Search LinkedIn profile by email address📧
Stars: ✭ 20 (-99.61%)
Mutual labels:  scraping, chromium, puppeteer
proxycrawl-python
ProxyCrawl Python library for scraping and crawling
Stars: ✭ 51 (-99.01%)
Mutual labels:  scraper, scraping, crawling
double-agent
A test suite of common scraper detection techniques. See how detectable your scraper stack is.
Stars: ✭ 123 (-97.6%)
Mutual labels:  scraping, crawling, puppeteer
throughout
🎪 End-to-end testing made simple (using Jest and Puppeteer)
Stars: ✭ 16 (-99.69%)
Mutual labels:  chromium, headless-chrome, puppeteer
Dataflowkit
Extract structured data from web sites. Web sites scraping.
Stars: ✭ 456 (-91.11%)
Mutual labels:  scraper, scraping, crawling
whatsapp-tracking
Scraping the status of WhatsApp contacts
Stars: ✭ 49 (-99.04%)
Mutual labels:  scraper, scraping, puppeteer
papercut
Papercut is a scraping/crawling library for Node.js built on top of JSDOM. It provides basic selector features together with features like Page Caching and Geosearch.
Stars: ✭ 15 (-99.71%)
Mutual labels:  crawler, scraper, scraping

Headless Chrome Crawler npm build Greenkeeper badge

API | Examples | Tips | Code of Conduct | Contributing | Changelog

Distributed crawler powered by Headless Chrome

Features

Crawlers based on simple requests to HTML files are generally fast. However, it sometimes ends up capturing empty bodies, especially when the websites are built on such modern frontend frameworks as AngularJS, React and Vue.js.

Powered by Headless Chrome, the crawler provides simple APIs to crawl these dynamic websites with the following features:

  • Distributed crawling
  • Configure concurrency, delay and retry
  • Support both depth-first search and breadth-first search algorithm
  • Pluggable cache storages such as Redis
  • Support CSV and JSON Lines for exporting results
  • Pause at the max request and resume at any time
  • Insert jQuery automatically for scraping
  • Save screenshots for the crawling evidence
  • Emulate devices and user agents
  • Priority queue for crawling efficiency
  • Obey robots.txt
  • Follow sitemap.xml
  • [Promise] support

Getting Started

Installation

yarn add headless-chrome-crawler
# or "npm i headless-chrome-crawler"

Note: headless-chrome-crawler contains Puppeteer. During installation, it automatically downloads a recent version of Chromium. To skip the download, see Environment variables.

Usage

const HCCrawler = require('headless-chrome-crawler');

(async () => {
  const crawler = await HCCrawler.launch({
    // Function to be evaluated in browsers
    evaluatePage: (() => ({
      title: $('title').text(),
    })),
    // Function to be called with evaluated results from browsers
    onSuccess: (result => {
      console.log(result);
    }),
  });
  // Queue a request
  await crawler.queue('https://example.com/');
  // Queue multiple requests
  await crawler.queue(['https://example.net/', 'https://example.org/']);
  // Queue a request with custom options
  await crawler.queue({
    url: 'https://example.com/',
    // Emulate a tablet device
    device: 'Nexus 7',
    // Enable screenshot by passing options
    screenshot: {
      path: './tmp/example-com.png'
    },
  });
  await crawler.onIdle(); // Resolved when no queue is left
  await crawler.close(); // Close the crawler
})();

Examples

See here for the full examples list. The examples can be run from the root folder as follows:

NODE_PATH=../ node examples/priority-queue.js

API reference

See here for the API reference.

Debugging tips

See here for the debugging tips.

FAQ

How is this different from other crawlers?

There are roughly two types of crawlers. One is static and the other is dynamic.

The static crawlers are based on simple requests to HTML files. They are generally fast, but fail scraping the contents when the HTML dynamically changes on browsers.

Dynamic crawlers based on PhantomJS and Selenium work magically on such dynamic applications. However, PhantomJS's maintainer has stepped down and recommended to switch to Headless Chrome, which is fast and stable. Selenium is still a well-maintained cross browser platform which runs on Chrome, Safari, IE and so on. However, crawlers do not need such cross browsers support.

This crawler is dynamic and based on Headless Chrome.

How is this different from Puppeteer?

This crawler is built on top of Puppeteer.

Puppeteer provides low to mid level APIs to manupulate Headless Chrome, so you can build your own crawler with it. This way you have more controls on what features to implement in order to satisfy your needs.

However, most crawlers requires such common features as following links, obeying robots.txt and etc. This crawler is a general solution for most crawling purposes. If you want to quickly start crawling with Headless Chrome, this crawler is for you.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].