crawlee

apifyApache-2.0活跃维护

Node.js/TypeScript 网页抓取与浏览器自动化库,内置代理轮换和反封锁,兼容 Puppeteer、Playwright、Cheerio,可稳定采集数据供 AI、LLM、RAG 使用。

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

v3.18.2发布于 2026-09-29 09:58 UTC26,401star +34 / 7 天1,750fork同步于 2026-11-10 05:21 UTC

怎么上手

由 README 提炼,执行前请确认
npx crawlee create my-crawler
cd my-crawler && npm start
# 手动安装:npm install crawlee playwright
硬件要求按 README 说明

README 未说明显存或 GPU 要求;需 Node.js 22.13 或更高版本,浏览器抓取依赖 Playwright 或 Puppeteer 所支持的 Chrome、Firefox、Webkit 等浏览器。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Node.js 爬虫与浏览器自动化库,帮你快速构建稳定、不易被反爬拦截的采集器

Node.js/TypeScript 网页抓取与浏览器自动化库,内置代理轮换和反封锁,兼容 Puppeteer、Playwright、Cheerio,可稳定采集数据供 AI、LLM、RAG 使用。

核心能力

  • 统一 HTTP 与无头浏览器两种抓取接口
  • 持久化 URL 队列,支持广度与深度优先
  • 内置代理轮换与会话管理
  • 自动生成类浏览器请求头与 TLS 指纹
  • 可插拔存储,结果落盘或上云

容易踩的坑

Playwright 不随 Crawlee 打包,用 PlaywrightCrawler 需单独安装;默认把数据写到当前目录下的 ./storage;与 Apify SDK 同用时需在 package.json 配置 overrides 避免重复安装 Crawlee。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.18.2
  1. v4.0.0-rc.1pre-release2026-10-06 · 2026-10-06 13:48 UTC
    查看更新说明

    Breaking since rc.0

    • @crawlee/jsdom and @crawlee/linkedom moved out of the monorepo (#4119)
    • Crawler-only code moved from @crawlee/core to @crawlee/basic, more internals made private (#4117, #4036, #4060)
    • Input handling moved to the Apify SDK, requires apify >= 4.0.0-beta.40 (#4155)
    • The request queue is no longer emptied between run() calls (#4056)
    • Statistics renames, IRequestManager / IBrowserPool contract updates (#4109, #4061, #4161)

    New

    • DomCrawler with a pluggable DOM parser (#4104)
    • OpenTelemetry instrumentation via @crawlee/otel (#3361)
    • skipRequest and afterCommit context helpers (#4158, #4110), initialConcurrency option (#4067), extractMicrodata helper (#3233)

    Fixes

    HTTP redirect handling for credentials, cookies and request bodies (#4137, #4154, #4136), Cloudflare challenge detection (#4170), a robots.txt 404 now means allow-all (#4171), and more.

    Upgrading guide: https://crawlee.dev/js/docs/next/upgrading/upgrading-to-v4

    Full Changelog: https://github.com/apify/crawlee/compare/v4.0.0-rc.0...v4.0.0-rc.1

  2. v3.18.2最新正式版2026-09-29 · 2026-09-29 09:58 UTC

    3.18.2 (2026-09-29)

    Bug Fixes

    • browser-pool: survive a page.close() that never settles (#4108) (31678af), closes #1829
    • core: notify() no longer leaks a timed-out task's context into the pool loop (#4096) (c7ee7e3), closes #4081
  3. v4.0.0-rc.0pre-release2026-08-13 · 2026-08-13 10:14 UTC
    查看更新说明
  4. v3.18.12026-08-12 · 2026-08-12 15:39 UTC
    查看更新说明

    3.18.1 (2026-08-12)

    Bug Fixes

  5. v3.18.02026-08-04 · 2026-08-04 14:30 UTC
    查看更新说明

    3.18.0 (2026-08-04)

    Bug Fixes

    • allow any clickOptions in enqueueLinksByClickingElements (#3823) (abcbfb1)
    • avoid duplicate final crawler persistence (#3866) (79dd6c4), closes #3167
    • basic-crawler: declare @apify/datastructures as a dependency (#3815) (4e9d227)
    • core: avoid re-submitting already-enqueued requests in addRequestsBatched (#3843) (704c269), closes #2456 #2456 #2456 #3120
    • core: cap retries for unprocessed requests in addRequestsBatched (#3765) (b3170a6), closes #3764
    • core: clear AutoscaledPool.pause() polling interval on timeout (#3847) (42b8914)
    • core: ignore explicitly undefined baseUrl in enqueueLinks helpers (#3924) (a58a9c1)
    • core: keep crawler enqueue limits when options carry explicit undefined (#3927) (5f1b0ab), closes #3924 #3924
    • core: keep same-domain filtering after an off-domain redirect (#3923) (9b312ef), closes #3921
    • core: remove RequestList persist state listener on teardown (#3846) (63394ee)
    • core: skip malformed cookie fragments in mergeCookies (#3822) (b3c3ef2)
    • core: unblock backpressured sitemap load on persistState (#3863) (0b31a8b)
    • declare missing dependencies (#3817) (5a9a661)
    • filter sitemap-derived URLs by enqueue strategy (#3797) (9dc3160)
    • impit-client: honor redirect handler for session cookie parity (#3938) (9371301)
    • make crawler terminal status message reliably delivered (#3733) ([7aed264](https://github.com/apify/crawlee/commit/

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Crawlee covers your crawling and scraping end-to-end and helps you build reliable scrapers. Fast.

    Your crawlers will appear human-like and fly under the radar of modern bot protections even with the default configuration. Crawlee gives you the tools to crawl the web for links, scrape data, and store it to disk or cloud while staying configurable to suit your project's needs.

    Crawlee is available as the crawlee NPM package.

    👉 View full documentation, guides and examples on the Crawlee project website 👈

    Do you prefer 🐍 Python instead of JavaScript? 👉 Checkout Crawlee for Python 👈.

    Installation

    We recommend visiting the Introduction tutorial in Crawlee documentation for more information.

    Crawlee requires Node.js 22.13 or higher.

    With Crawlee CLI

    The fastest way to try Crawlee out is to use the Crawlee CLI and choose the Getting started example. The CLI will install all the necessary dependencies and add boilerplate code for you to play with.

    npx crawlee create my-crawler
    
    cd my-crawler
    npm start
    

    Manual installation

    If you prefer adding Crawlee into your own project, try the example below. Because it uses PlaywrightCrawler we also need to install Playwright. It's not bundled with Crawlee to reduce install size.

    npm install crawlee playwright
    
    import { PlaywrightCrawler, Dataset } from 'crawlee';
    
    // PlaywrightCrawler crawls the web using a headless
    // browser controlled by the Playwright library.
    const crawler = new PlaywrightCrawler({
        // Use the requestHandler to process each of the crawled pages.
        async requestHandler({ request, page, enqueueLinks, log }) {
            const title = await page.title();
            log.info(`Title of ${request.loadedUrl} is '${title}'`);
    
            // Save results as JSON to ./storage/datasets/default
            await Dataset.pushData({ title, url: request.loadedUrl });
    
            // Extract links from the current page
            // and add them to the crawling queue.
            await enqueueLinks();
        },
        // Uncomment this option to see the browser window.
        // headless: false,
    });
    
    // Add first URL to the queue and start the crawl.
    await crawler.run(['https://crawlee.dev']);
    

    By default, Crawlee stores data to ./storage in the current working directory. You can override this directory via Crawlee configuration. For details, see Configuration guide, Request storage and Result storage.

    Installing pre-release versions

    We provide automated beta builds for every merged code change in Crawlee. You can find them in the npm list of releases. If you want to test new features or bug fixes before we release them, feel free to install a beta build like this:

    npm install crawlee@next
    

    If you also use the Apify SDK, you need to specify dependency overrides in your package.json file so that you don't end up with multiple versions of Crawlee installed:

    {
        "overrides": {
           "apify": {
               "@crawlee/core": "$crawlee",
               "@crawlee/types": "$crawlee",
               "@crawlee/utils": "$crawlee"
           }
        }
    }
    

    🛠 Features

    • Single interface for HTTP and headless browser crawling
    • Persistent queue for URLs to crawl (breadth & depth first)
    • Pluggable storage of both tabular data and files
    • Automatic scaling with available system resources
    • Integrated proxy rotation and session management
    • Lifecycles customizable with hooks
    • CLI to bootstrap your projects
    • Configurable routing, error handling and retries
    • Dockerfiles ready to deploy
    • Written in TypeScript with generics

    👾 HTTP crawling

    • Zero config HTTP2 support, even for proxies
    • Automatic generation of browser-like headers
    • Replication of browser TLS fingerprints
    • Integrated fast HTML parsers. Cheerio and JSDOM
    • Yes, you can scrape JSON APIs as well

    💻 Real browser crawling

    • JavaScript rendering and screenshots
    • Headless and headful support
    • Zero-config generation of human-like fingerprints
    • Automatic browser management
    • Use Playwright and Puppeteer with the same interface
    • Chrome, Firefox, Webkit and many others

    Usage on the Apify platform

    Crawlee is open-source and runs anywhere, but since it's developed by Apify, it's easy to set up on the Apify platform and run in the cloud. Visit the Apify SDK website to learn more about deploying Crawlee to the Apify platform.

    Support

    If you find any bug or issue with Crawlee, please submit an issue on GitHub. For questions, you can ask on Stack Overflow, in GitHub Discussions or you can join our Discord server.

    Contributing

    Your code contributions are welcome, and you'll be praised to eternity! If you have any ideas for improvements, either submit an issue or create a pull request. For contribution guidelines and the code of conduct, see CONTRIBUTING.md.

    License

    This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details.