{"record":{"id":"fe217cd892a5e6fc","repo":"apify/crawlee","slug":"the-parsewithcheerio-method-is-not-available","errorCode":null,"errorMessage":"The `parseWithCheerio` method is not available - `skipNavigation` was used","messagePattern":"The `parseWithCheerio` method is not available - `skipNavigation` was used","errorType":"exception","errorClass":"NavigationSkippedError","httpStatus":null,"severity":"error","filePath":"packages/http-crawler/src/internals/http-crawler.ts","lineNumber":577,"sourceCode":"                    );\n                },\n                get body(): InternalHttpCrawlingContext['body'] {\n                    throw new NavigationSkippedError(\n                        'The `body` property is not available - `skipNavigation` was used',\n                    );\n                },\n                get json(): InternalHttpCrawlingContext['json'] {\n                    throw new NavigationSkippedError(\n                        'The `json` property is not available - `skipNavigation` was used',\n                    );\n                },\n                get waitForSelector(): InternalHttpCrawlingContext['waitForSelector'] {\n                    throw new NavigationSkippedError(\n                        'The `waitForSelector` method is not available - `skipNavigation` was used',\n                    );\n                },\n                get parseWithCheerio(): InternalHttpCrawlingContext['parseWithCheerio'] {\n                    throw new NavigationSkippedError(\n                        'The `parseWithCheerio` method is not available - `skipNavigation` was used',\n                    );\n                },\n            };\n        }\n\n        tryCancel();\n\n        // Before `parseResponse`, which throws for error status codes - a 429 the user opted into treating as an\n        // error is still a rate limit the domain should back off from.\n        if (crawlingContext.response.status === 429) {\n            const retryAfter = crawlingContext.response.headers.get('retry-after');\n            if (this.recordDomainRateLimit(crawlingContext.request.url, retryAfter)) {\n                // This is the one path that never reads the body, so cancel it to release the connection\n                // rather than leaving it to the garbage collector.\n                await crawlingContext.response.body?.cancel().catch(() => {});\n                throw new RequestThrottledError(`${crawlingContext.request.url} responded with 429.`);\n            }","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/http-crawler/src/internals/http-crawler.ts#L559-L595","documentation":"NavigationSkippedError thrown by the getter for `parseWithCheerio` on the crawling context. Without navigation there is no HTML document, so cheerio parsing is unavailable and access throws immediately.","triggerScenarios":"Calling `const $ = await context.parseWithCheerio()` in a request handler for a `skipNavigation: true` request.","commonSituations":"Standard scraping handlers applied to seed requests; helpers that unconditionally parse HTML from every context.","solutions":["Guard `parseWithCheerio` behind `!context.request.skipNavigation`.","Parse HTML only in handlers that follow a real navigation; use `userData` payloads for skipped requests.","Route skipNavigation requests via labels to a non-parsing handler."],"exampleFix":"// before\nconst $ = await context.parseWithCheerio();\n// after\nif (context.request.skipNavigation) { return; }\nconst $ = await context.parseWithCheerio();","handlingStrategy":"type-guard","validationCode":"if (request.skipNavigation) { return; }\nconst $ = await ctx.parseWithCheerio();","typeGuard":"function canParse(ctx: CrawlingContext): boolean { return !(ctx.request as any).skipNavigation; }","tryCatchPattern":"try { const $ = await ctx.parseWithCheerio(); } catch (err) { if (err instanceof NavigationSkippedError) { return; /* nothing to parse */ } throw err; }","preventionTips":["Early-return before parsing when skipNavigation.","Only call parseWithCheerio in handlers that follow navigation.","Dedicated seed handlers that enqueue and return.","Lint for unconditional parseWithCheerio in shared code."],"tags":["skip-navigation","cheerio","http-crawler"],"backgroundTag":"navigation-skipped-property-access","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}