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.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
test(e2e): use impit in the robots file test (#3857)
Martin Adámek4d882e6d58ad
diff --git a/test/e2e/cheerio-robots-file/actor/main.js b/test/e2e/cheerio-robots-file/actor/main.jsindex 820f4be4b..c24a56e94 100644--- a/test/e2e/cheerio-robots-file/actor/main.js+++ b/test/e2e/cheerio-robots-file/actor/main.js@@ -1,4 +1,5 @@import { CheerioCrawler } from '@crawlee/cheerio';+import { Browser, ImpitHttpClient } from '@crawlee/impit-client';import { Actor } from 'apify';await Actor.init({@@ -9,8 +10,9 @@ await Actor.init({});const crawler = new CheerioCrawler({- // The store rate-limits the platform's shared egress IP, so crawl through a proxy.proxyConfiguration: await Actor.createProxyConfiguration(),+ // The store 429s plain HTTP clients; impersonating a browser gets us through.+ httpClient: new ImpitHttpClient({ browser: Browser.Firefox }),maxRequestsPerCrawl: 10,respectRobotsTxtFile: true,});diff --git a/test/e2e/cheerio-robots-file/actor/package.json b/test/e2e/cheerio-robots-file/actor/package.jsonindex e101f7a74..32ff9de44 100644--- a/test/e2e/cheerio-robots-file/actor/package.json+++ b/test/e2e/cheerio-robots-file/actor/package.json@@ -11,6 +11,7 @@"@crawlee/core": "file:./packages/core","@crawlee/memory-storage": "file:./packages/memory-storage","@crawlee/cheerio": "file:./packages/cheerio-crawler",+ "@crawlee/impit-client": "file:./packages/impit-client","@crawlee/types": "file:./packages/types","@crawlee/utils": "file:./packages/utils"},