Skip to main content
If you’re coming from Scrapy, you’ll feel right at home with Scrapling’s spider system. The API is intentionally familiar, but Scrapling brings modern Python async/await patterns, simplified session management, and built-in pause/resume capabilities. This guide will help you migrate your existing Scrapy spiders to Scrapling.

Core Concepts Comparison

Spider Structure Comparison

Basic Spider

Key differences:
  1. parse() must be an async generator in Scrapling
  2. Type hint Response for better IDE support
  3. Must specify callback=self.parse explicitly in follow requests

Running the Spider

Advanced Features Comparison

Multiple Callbacks

Request Metadata

Concurrency Control

Allowed Domains

Item Processing

Item Pipelines vs Hooks

Session Management (Middlewares Alternative)

Using Different Session Types

Scrapy uses middlewares for request/response processing. Scrapling uses a session-based architecture:

Proxy Configuration

Pause & Resume

Scrapy requires jobs directory configuration and command-line management. Scrapling makes it simple:

Lifecycle Hooks

Logging

Selector Syntax

Good news! Scrapling uses the same selector syntax as Scrapy:

Streaming Results

Scrapy doesn’t have built-in streaming. Scrapling does:
Scrapling Only

Complete Migration Example

Here’s a complete Scrapy spider migrated to Scrapling:

Key Advantages of Scrapling

  1. Modern Async/Await: Native async/await instead of Twisted deferreds
  2. Simpler Architecture: No need for separate settings.py, items.py, pipelines.py
  3. Built-in Sessions: Multiple fetcher types (HTTP, browser, stealth) in one spider
  4. Easy Pause/Resume: Just pass crawldir parameter
  5. Real-time Streaming: Stream items as they’re scraped with spider.stream()
  6. Better Performance: Optimized parsing that’s faster than Scrapy’s Parsel
  7. Type Hints: Full type coverage for better IDE support
  8. Simpler API: Less boilerplate, more Pythonic

What Scrapling Doesn’t Have

  • No built-in commands system (like scrapy genspider)
  • No extensions system (use Python decorators/inheritance)
  • No contracts for testing (use standard Python testing)
  • Simpler than Scrapy’s full framework approach

Next Steps

Scrapling gives you the power of Scrapy with a modern, simpler API. Happy scraping!