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.

test: fix proxy rotation e2e test

Martin Adámek5855ff3ed6b7
diff --git a/test/e2e/proxy-rotation/actor/main.js b/test/e2e/proxy-rotation/actor/main.js
index 82419420a..00741af34 100644
--- a/test/e2e/proxy-rotation/actor/main.js
+++ b/test/e2e/proxy-rotation/actor/main.js
@@ -11,9 +11,8 @@ await Actor.main(async () => {
proxyConfiguration: await Actor.createProxyConfiguration(),
maxConcurrency: 1,
sessionPoolOptions: { sessionOptions: { maxUsageCount: 1 } },
- async requestHandler({ page }) {
- const pageContent = await page.evaluate(() => document.body.children[0].innerText);
- const { clientIp } = JSON.parse(pageContent);
+ async requestHandler({ response }) {
+ const { clientIp } = await response.json();
const presentAlready = await KeyValueStore.getValue(clientIp);
if (presentAlready) {