Files
playwright/docs/guides-scraping-with-playwright.md
Federico ed2259a405 Ten pages on the Selenium, Puppeteer and Python-automation gap (#192)
* Ten pages on the Selenium/Puppeteer/Python-automation gap the wiki never covered

Measured before writing: SERP winnability and demand on the shortlist, and a
cosine-similarity gap check against the full 452-page corpus (threshold 0.52),
so every title lands where nothing already answers it above that bar.

Split from AIHawk's MCP-agent wave on purpose: this wiki is developer
mechanism (protocol, driver architecture, what a page can and cannot see),
not agent-task language, per the perimeter both wikis already follow.

Gates run: english-only clean, no em/en-dash in the new or touched files, all
internal .md links resolve to real files, build_wiki.py renders the full 473
pages with zero unresolved .md links in the output. In-body link density
(prose only, footer excluded) checked and raised where it was thin - one page
shipped at zero in-body links on the first pass, four more under 2/1000
words; all ten now sit between 3.0 and 6.2/1000, matching the range this
project already measured (2-5/1000, median 3.4) rather than assumed.

What is NOT independently verified this session: several claims (Selenium's
WebDriver architecture, CORS enforcement, headless-mode history) are sourced
to public documentation linked inline rather than fetched live in this
session, and the code/command blocks (curl, Puppeteer's API, Playwright's
launch snippet) are written, not executed against a live target. Both are
gaps against this project's own pipeline standard and are noted here rather
than left implicit.

* The same pipeline pass on these ten, and the two defects it found here

Titles averaged 42 characters against a house median of 49 and a stated window
of 50-60; descriptions ran 198-260 against a house median of 159. All 20 values
rewritten, verified by a check that refuses to write when a pair falls outside
the window.

And the first-party evidence the pipeline requires and these pages did not
have. Three now carry a measurement from this project rather than a citation to
somebody else's documentation:

- The same build rendering text across 48 family/size/weight combinations
  produced 9-19 distinct alpha levels per render on Windows and 193-256 on
  Linux, 16 of 48 using all 256. Same code, same display mode, different host.
  It is the number that separates a machine fact from a headless fact, which is
  what the headless page is arguing.
- An A/B/A on one build: a CSS system-font value read from the host rather than
  from the declared identity moved a detector from tampering=False/4/0 to
  True/12/1 and back to False/4/0. One value, both directions.
- Font ascent and descent diverged on 58 of 72 families across hosts on one
  build while every advance width already matched, because shaping is the same
  in-tree library. The layer below the frameworks is larger than the gap
  between them, which is what the Selenium-vs-Playwright page needed to say
  with a number instead of an adjective.

Gates: english-only clean, no dashes, no invisible codepoints, no CRLF, all
internal links resolve, in-body link density 2.6-10.1 per 1000 words against
the measured house range, and the full 473-page wiki renders with zero
unresolved links.
2026-09-10 11:42:34 +02:00

37 KiB

title, description, parent, has_children, nav_order
title description parent has_children nav_order
Scraping with Playwright Practical how-tos for real scraping problems - blocked headless browsers, infinite scroll, proxy rotation, sessions behind a login - written against a real patched Firefox driven by stock Playwright. Guides true 8

Scraping with Playwright

The rest of the Guides explain how a single surface gives you away. This group is the other direction: a concrete task, in order, with the code that does it and the specific thing that breaks it.

Every page here is written against a real browser instead of a generic recipe. The launch is a two-line change from stock Playwright, the browser returned is a real Playwright Browser with no wrapped subset to learn, and each how-to carries at least one mistake we made first, measured and fixed, not assumed.

Start with how to scrape without getting blocked for the model that orders the rest, then pick the task you have.

Get past blocking

Page mechanics: waiting, pagination and crawl flow

Forms, widgets and page controls

Extracting content and structured data

Files, images and media

Products, prices and shopping

Listings, travel and live data by vertical

Output, storage and data cleaning

Sessions, scheduling and running at scale

Specific objects and data shapes