puppeteer-fetch is a Node.js library that wraps Puppeteer to provide a fetch-like API for HTTP requests, mimicking the node-fetch interface but using Puppeteer as the underlying driver. This enables scraping of JavaScript-rendered pages and bypassing WAF protections. Current stable version is 0.3.1, released occasionally with minimal updates. It ships TypeScript types and requires Node >=14.15. Key differentiators: it combines the simplicity of fetch with Puppeteer's ability to handle dynamic content and anti-bot measures.
npm install puppeteer-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic GET request with puppeteer-fetch, using async/await and JSON parsing.
Ensure you use .default when importing with CommonJS: const fetch = require('puppeteer-fetch').default;Run: npm install puppeteer
Use standard fetch properties but test edge cases like .clone() which may not be available.
Use the latest API: fetch(url, fetchOptions, { puppeteerConfig: { ... } })Use const fetch = require('puppeteer-fetch').default; or switch to ES module import.Install puppeteer: npm install puppeteer
If using ES modules with CommonJS package, use import fetch from 'puppeteer-fetch' (with .default omitted in TypeScript with esModuleInterop). Otherwise use const fetch = require('puppeteer-fetch').default;