Files
apify--crawlee/docs/guides/avoid_blocking_camoufox.ts
2026-07-13 13:23:39 +08:00

23 lines
618 B
TypeScript

import { PlaywrightCrawler } from 'crawlee';
import { launchOptions } from 'camoufox-js';
import { firefox } from 'playwright';
const crawler = new PlaywrightCrawler({
postNavigationHooks: [
async ({ handleCloudflareChallenge }) => {
await handleCloudflareChallenge();
},
],
browserPoolOptions: {
// Disable the default fingerprint spoofing to avoid conflicts with Camoufox.
useFingerprints: false,
},
launchContext: {
launcher: firefox,
launchOptions: await launchOptions({
headless: true,
}),
},
// ...
});