JavaScript Camoufox scraper
A Firefox-based browser built to look like a real user and bypass bot protection.
src/main.js
src/routes.js
1/**2 * This template is a production ready boilerplate for developing with `PlaywrightCrawler`.3 * Use this to bootstrap your projects using the most up-to-date code.4 * If you're looking for examples or want to learn more, see README.5 */6
7// For more information, see https://crawlee.dev8import { PlaywrightCrawler } from '@crawlee/playwright';9// For more information, see https://docs.apify.com/sdk/js10import { Actor } from 'apify';11import { launchOptions as camoufoxLaunchOptions } from 'camoufox-js';12import { firefox } from 'playwright';13
14// this is ESM project, and as such, it requires you to specify extensions in your relative imports15// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions16import { router } from './routes.js';17
18// Initialize the Apify SDK19await Actor.init();20
21const { startUrls = ['https://apify.com'] } = (await Actor.getInput()) ?? {};22
23// `checkAccess` flag ensures the proxy credentials are valid, but the check can take a few hundred milliseconds.24// Disable it for short runs if you are sure your proxy configuration is correct25const proxyConfiguration = await Actor.createProxyConfiguration({ checkAccess: true });26
27const crawler = new PlaywrightCrawler({28 proxyConfiguration,29 requestHandler: router,30 launchContext: {31 launcher: firefox,32 launchOptions: await camoufoxLaunchOptions({33 headless: true,34 proxy: await proxyConfiguration.newUrl(),35 geoip: true,36 // fonts: ['Times New Roman'], // <- custom Camoufox options37 }),38 },39});40
41await crawler.run(startUrls);42
43// Exit successfully44await Actor.exit();This template is a production-ready boilerplate for developing an Actor with PlaywrightCrawler. It has Camoufox - a stealthy fork of Firefox - preinstalled. Note that Camoufox might consume more resources than the default Playwright-bundled Chromium or Firefox.
Use this template to bootstrap your projects using the most up-to-date code.
We decided to split Apify SDK into two libraries, Crawlee and Apify SDK v3. Crawlee will retain all the crawling and scraping-related tools and will always strive to be the best web scraping library for its community. At the same time, Apify SDK will continue to exist, but keep only the Apify-specific features related to building Actors on the Apify platform. Read the upgrading guide to learn about the changes.
If you're looking for examples or want to learn more visit:
- Crawlee + Apify Platform guide
- Documentation and examples
- Node.js tutorials in Academy
- Scraping single-page applications with Playwright
- How to scale Puppeteer and Playwright
- Integration with Zapier , Make, GitHub, Google Drive and other apps
- Video guide on getting data using Apify API
- A short guide on how to create Actors using code templates:
JavaScript Cheerio crawler
A fast HTTP crawler that extracts data from every page. Good for simple sites like blogs, news, or product listings, but it can't run client-side JavaScript.
JavaScript one-page scraper
Get data from one web page with Cheerio. The simplest way to start scraping.
JavaScript Puppeteer scraper
A headless Chrome scraper that renders JavaScript before extracting data. Good for social feeds, dashboards, or single-page apps.
JavaScript Playwright scraper
A Playwright-based browser scraper supporting multiple browsers and contexts.
Cheerio crawler (advanced)
A minimal crawler for developers who already know the Apify SDK and Crawlee.
Cypress test runner
A cloud test runner for Cypress that saves results and videos.