Scraping via Puppeteer/Playwright (Headless Browser)

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Scraping via Puppeteer/Playwright (Headless Browser)
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Implementation of Scraping via Puppeteer/Playwright (Headless Browser)

Headless browsers are tools for scraping sites that can't be processed with static HTML parser: React/Vue/Angular pages, lazy-loaded content, authenticated data, dynamic tables with infinite scroll.

Puppeteer vs Playwright

Parameter Puppeteer Playwright
Browsers Chrome/Chromium Chrome, Firefox, Safari
Language Node.js Node.js, Python, Java, C#
Auto-wait No (explicit waits) Yes (auto-wait elements)
Development speed Medium Higher
Ecosystem maturity High Growing

Playwright preferred for new projects: its auto-wait significantly reduces scraping errors—no need to manually wait for each element.

Typical Scraping Scenario

// Playwright: parse catalog with infinite scroll
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
  userAgent: 'Mozilla/5.0 ...',
  viewport: { width: 1280, height: 900 }
});
const page = await context.newPage();

await page.goto('https://example.com/catalog');

// Scroll to bottom
let prevHeight = 0;
while (true) {
  const height = await page.evaluate(() => document.body.scrollHeight);
  if (height === prevHeight) break;
  await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
  await page.waitForTimeout(1500 + Math.random() * 1000);
  prevHeight = height;
}

// Extract data
const items = await page.$$eval('.product-card', cards =>
  cards.map(card => ({
    title: card.querySelector('.title')?.textContent?.trim(),
    price: card.querySelector('.price')?.textContent?.trim(),
    url: card.querySelector('a')?.href
  }))
);

Performance Optimization

Browser startup is expensive. For industrial scraping:

  • Browser context pool—one Chrome process, multiple isolated contexts
  • Disable resources—block font, image, analytics loading via page.route()
  • Clusteringplaywright-cluster or self-written pool with worker_threads

Blocking unnecessary traffic reduces page load time 40–70% and memory usage.

Headless Browser Detection

Modern protections (DataDome, PerimeterX, Cloudflare Bot Management) detect automation by dozens of signals. Main bypass methods:

  • playwright-stealth—patches navigator.webdriver and other detectable fields
  • Realistic mouse movements via playwright-mouse-helper
  • Unique fingerprints—different viewport, timezone, locale per session

Timeline

Basic scraper for one site: 2–4 days. Scraper with protection bypass, proxy rotation, monitoring: 7–10 days.