Playwright's `page.route()` method installs a handler that intercepts matching requests before they are sent over the network. The handler can fulfil the request with a mock response, abort it entirely (useful for blocking images, fonts, or analytics scripts to speed up loads), modify the request URL or headers before forwarding, or simply log the request and let it pass through.
For data extraction, route interception is powerful: it allows the scraper to capture JSON API responses that power a page's dynamic content, without needing to parse the rendered HTML. The captured JSON is typically cleaner and more structured than scraped DOM content.
Route interception also enables performance optimisation: blocking resource types like `image`, `font`, `media`, and `stylesheet` reduces page load time by 50–80% for data-extraction tasks that only need HTML content, and significantly reduces bandwidth consumption in large-scale browser-based scraping.