Skip to content

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.

879 B
Raw Blame
---
id: skip-request
title: Skipping requests
---

import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock';
import ApiLink from '@site/src/components/ApiLink';
import SkipRequestSource from '!!raw-loader!roa-loader!./skip-request.ts';

Calling <ApiLink to="basic-crawler/interface/RestrictedCrawlingContext#skipRequest">`skipRequest()`</ApiLink> stops processing the current request without counting it as a failure: it is marked as handled, is not retried, does not reach `failedRequestHandler`, and its storage writes are rolled back. It works in `extendContext`, navigation hooks, the request handler and the `errorHandler`, and each skip is reported to <ApiLink to="basic-crawler/interface/BasicCrawlerOptions#onSkippedRequest">`onSkippedRequest`</ApiLink>.

<RunnableCodeBlock className="language-js" type="cheerio">
	{SkipRequestSource}
</RunnableCodeBlock>