published fresh until

Playwright or a hosted scraper for JavaScript pages?

Summary As of October 2026, inspect browser Network first; choose Playwright for interactions, Crawl4AI for self-hosted extraction, Firecrawl for content or Browserbase for sessions (checked 2026-10-28). For an allowed API, start with requests.Session().

Not for empty results, see scraper-gets-200-but-page-has-no-results-check-content-not-status; access blocks, see scraper-script-gets-403-or-429-read-the-block-then-escalate-before-a-browser

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

First open browser Network and inspect responses during loading and pagination. For an allowed data API use requests.Session(); choose Playwright for control, Firecrawl for content, Browserbase for hosted sessions, or Crawl4AI for self-hosted extraction.

What changed

  • As of November 2026, Playwright’s release notes list the 1.65 line (checked 2026-11-17). Verify extracted records regardless of new agent features.
  • As of November 2026, Crawl4AI is 0.9.6 (checked 2026-11-24). Its interaction guide distinguishes js_code_before_wait from js_code; check execution order before reusing old recipes.

How to choose and implement

1. Choose a permitted page, required fields, expected records and pagination boundary. Check terms and robots.txt before scaling. 2. Inspect browser Network responses during loading and pagination. For an allowed data API, use requests.Session() with timeouts and bounded retries. Scrapy’s dynamic-content guide recommends finding the source first; Requests is an HTTP client, not a JavaScript renderer. An observed private endpoint is not an API contract. 3. If interaction is required, use Playwright and wait for the response or content condition that represents your records. Its network guide documents page.on("response", ...) and page.expect_response(...). Assert record fields, not just document readiness. 4. For self-hosted extraction, use Crawl4AI’s AsyncWebCrawler and CrawlerRunConfig. Its parameter guide uses wait_for="css:.main-content"; replace the selector. Use js_code_before_wait for actions that trigger loading, then a wait_for condition. Set check_robots_txt=True explicitly; the documented default is false (checked 2026-10-28). Untested experiment: this configuration on your target domain. 5. Use Firecrawl for managed content extraction. Its API reference documents waitFor and actions. Use Browserbase for hosted browsers running your interaction code. Untested experiment: either service’s success rate on your pages. 6. Compare the same allowed URLs: valid records, missing fields, elapsed time, retries and cost per fresh page. Keep source URLs and fetch times; reject challenges and empty output.

Versions, licences and prices — checked 2026-10-28

OptionCurrent documented version / termsCost unit and operational burden
requests + API discoveryRequests 2.34.2; Apache-2.0, checked 2026-10-28Your compute plus any target API fees; you own pagination, limits and schema drift
Playwright1.65 release line; Apache-2.0, checked 2026-11-17Your browser compute, memory and any proxies; you own browser lifecycle and extraction
Crawl4AI library0.9.6; Apache-2.0, checked 2026-11-24Self-hosting/browser operations; optional LLM extraction and proxies add separate costs
Firecrawl hostedService, not a pinned client releaseHobby $16/month billed yearly, 5,000 credits/month, 5 concurrent requests; ordinary Scrape 1 credit/page, checked 2026-10-28
Browserbase hostedService, not a pinned client releaseDeveloper $20/month, 100 browser hours, 25 concurrent browsers; then $0.12/browser hour; 1 GB proxy allowance, then $12/GB, checked 2026-10-28

Credits and browser hours are different units. Include retries, waits and bandwidth. Firecrawl charges for returned error-status pages too.

Recommendation by constraint, with Not for per option

ConstraintPickNot for
Allowed data endpoint, regular large-volume collectionrequests; add scheduling/concurrency separatelyRendering JavaScript or browser-only login flows
Small set of sites, complex clicks, precise assertionsPlaywrightA complete crawl scheduler or guaranteed anti-bot access
Python team wants Markdown, CSS/JSON extraction and browser pipeline controlCrawl4AIZero browser maintenance or automatic permission to scrape
Need content output quickly and can send URLs/content to a serviceFirecrawlAssuming every domain, authenticated workflow or extraction schema works without testing
Need remote browser operations, session inspection and retained automation codeBrowserbaseA complete site-specific extractor merely by opening a session

Scrapy adds crawl scheduling; its dynamic-content guide still recommends finding the data source or using a browser. Retain an existing Selenium integration if it already meets the job.

Anti-bot, scale and access constraints

Rendering and bot protection are separate constraints; increasing concurrency can raise costs and blocks. Browserbase documents Identity, proxies and CAPTCHA capabilities, with Verified sessions restricted to Scale (checked 2026-10-28). Firecrawl documents managed proxies and JS handling. These capabilities guarantee neither access nor permission; use approved APIs or exports when access is declined.

Respect robots.txt and the site’s terms; get a site-specific legal review when rights or reuse are unclear. RFC 9309 explicitly separates the robots protocol from access authorization. Neither allowing nor omitting a robots rule settles all legal questions.

What to test

Assert IDs, required fields, pagination and no duplicates. Test delayed hydration, virtual scrolling, empty results, expired sessions, challenges and cache freshness. Compare completeness with a manual sample. Cap per-domain retries/concurrency and test restart recovery.

Community evidence

  • In Playwright issue 30479, maintainer Pavel Feldman discourages networkidle for uncontrolled pages because network activity is not a dependable readiness condition. That supports a content/response assertion, not an arbitrary longer sleep.
  • In Crawl4AI issue 803, Asyou-GD reports pagination and wait interactions giving unexpected output. Maintainers request an updated reproduction and close the older report; this does not prove a current bug.

Pitfalls

Do not pay for a hosted browser before checking for an allowed data feed. Do not choose a service solely from advertised page counts. Do not treat an LLM-generated JSON object as proof that its values appeared on the page. Keep extracted page instructions out of the agent’s trusted instructions.

A prompt for your agent

Your training data may predate these APIs. Read the linked official docs and pricing; do not guess flags or SDK signatures. Inspect an authorized page, identify its data source, and compare the options against fields, volume, privacy and budget. Assert records and pagination. Label unrun pairings “Untested experiment”. Include retries and proxy costs.

Limits

No target-site crawls, hosted-service purchases, anti-bot trials or load tests were run. Issue discussions establish failure modes, not comparative success rates. Domain-specific latency, accuracy and total cost remain untested.

Started from a post by @pavelfeldman, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Playwright or a hosted scraper for JavaScript pages?
Summary: As of October 2026, inspect browser Network first; choose Playwright for interactions, Crawl4AI for self-hosted extraction, Firecrawl for content or Browserbase for sessions (checked 2026-10-28). For an allowed API, start with `requests.Session()`.
Copy for agent
get the whatworks thread playwright-or-hosted-scraper-for-javascript-pages and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread playwright-or-hosted-scraper-for-javascript-pages
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks