Skip to content

kimuraivscrawlee

MIT - - -
2.9 thousand (month) Aug 23 2018 2.2.0(2026-01-27 17:36:19 ago)
26,606 30 131 Apache-2.0
Apr 22 2022 791.9 thousand (month) 3.18.2(2026-11-27 20:11:10 ago)

Kimurai is a modern web scraping framework for Ruby, inspired by Python's Scrapy. It provides a structured approach to building web scrapers with built-in support for multiple browser engines, session management, and data pipelines.

Key features include:

  • Multiple engine support Can use different backends depending on the scraping needs: Mechanize for simple HTTP requests, Selenium with headless Chrome/Firefox for JavaScript-rendered pages, and Poltergeist (PhantomJS) for lightweight rendering.
  • Scrapy-like architecture Follows the spider pattern: define a spider class with start URLs and parsing methods, and the framework handles crawling, scheduling, and data collection.
  • Built-in data pipelines Save scraped data to JSON, CSV, or custom formats with configurable output pipelines.
  • Session management Maintains browser sessions with automatic cookie handling and configurable delays between requests.
  • Request scheduling Built-in request queue with configurable concurrency, delays, and retry logic.
  • CLI tools Command-line tools for generating new spiders, running individual spiders, and managing scraping projects.

Kimurai is the closest Ruby equivalent to Scrapy. It's well-suited for structured scraping projects that need organization, multiple spiders, and data pipeline processing.

Note: Kimurai has not seen active development recently, but it remains a useful framework for Ruby scraping projects and is included as the most complete Ruby scraping framework available.

Crawlee is a modern web scraping and browser automation framework for JavaScript and TypeScript, built by Apify. It is the successor to the Apify SDK and provides a unified interface for building reliable web scrapers and crawlers that can scale from simple scripts to large-scale data extraction projects.

Crawlee supports multiple crawling strategies through different crawler classes:

  • CheerioCrawler For fast, lightweight HTML scraping using Cheerio (no browser needed). Best for static pages.
  • PlaywrightCrawler Uses Playwright for full browser automation. Handles JavaScript-rendered pages, SPAs, and complex interactions.
  • PuppeteerCrawler Similar to PlaywrightCrawler but uses Puppeteer as the browser automation backend.
  • HttpCrawler Minimal crawler for raw HTTP requests without HTML parsing.

Key features include:

  • Automatic request queue management with configurable concurrency and rate limiting
  • Built-in proxy rotation with session management
  • Persistent request queue and dataset storage (local or cloud via Apify)
  • Automatic retry and error handling with configurable strategies
  • TypeScript-first design with full type safety
  • Middleware-like request/response hooks (preNavigationHooks, postNavigationHooks)
  • Output pipelines for storing extracted data
  • Easy deployment to Apify cloud platform

Crawlee is considered the most feature-complete web scraping framework in the JavaScript/TypeScript ecosystem, comparable to Python's Scrapy but with native browser automation support.

Highlights


middlewaresoutput-pipelines
populartypescriptextendiblemiddlewaresoutput-pipelineslarge-scaleproxy

Example Use


require 'kimurai'

class ProductSpider < Kimurai::Base
  @name = 'product_spider'
  @engine = :selenium_chrome  # or :mechanize for simple pages
  @start_urls = ['https://example.com/products']

  def parse(response, url:, data: {})
    # Extract product data from current page
    response.css('.product').each do |product|
      item = {
        name: product.css('.name').text.strip,
        price: product.css('.price').text.strip,
        url: absolute_url(product.at_css('a')['href'], base: url),
      }

      # Send item to the pipeline
      save_to "products.json", item, format: :json
    end

    # Follow pagination links
    if next_page = response.at_css('a.next-page')
      request_to :parse, url: absolute_url(next_page['href'], base: url)
    end
  end
end

# Run the spider
ProductSpider.crawl!
import { PlaywrightCrawler, Dataset } from 'crawlee';

// Create a crawler with Playwright for JS rendering
const crawler = new PlaywrightCrawler({
    // Limit concurrency to avoid overwhelming the target
    maxConcurrency: 5,

    // This function is called for each URL
    async requestHandler({ request, page, enqueueLinks }) {
        const title = await page.title();

        // Extract data from the page
        const products = await page.$$eval('.product', (els) =>
            els.map((el) => ({
                name: el.querySelector('.name')?.textContent,
                price: el.querySelector('.price')?.textContent,
            }))
        );

        // Store extracted data
        await Dataset.pushData({
            url: request.url,
            title,
            products,
        });

        // Follow links to crawl more pages
        await enqueueLinks({
            globs: ['https://example.com/products/**'],
        });
    },
});

// Start crawling
await crawler.run(['https://example.com/products']);

Alternatives / Similar


Was this page helpful?