- How you use it
- Runs as a workflow step
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | AWorkflow · v1.0.0Saved-HTML extraction contract and fixtures for scrapers |
|---|---|
| How you use it | Runs as a workflow step |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
The problem
You ask a coding agent for a scraper. On a simple static page it works; on a real, dynamic site you get scripts that return nothing, selectors that break next week, or a long loop that burns tokens reading raw HTML. An August 2025 r/webscraping post titled along the lines of "AI for real-world scraping is basically useless" voices that frustration: the poster's agent produced "endless scripts that don't work" against a defended government site. The question is what to hand the agent so it has a chance.
What the thread says
The February 2026 r/webscraping thread "How are you using AI to help build scrapers?" (poster lieutenant_lowercase) has these recurring answers, from different commenters:
- Give it the traffic, not the page. One commenter exports a HAR file containing just the requests needed, adds a custom prompt on how to build the scraper, and has it integrated "after a few minutes". Another goes to the site's own XHR endpoints where they exist and falls back to a full browser only when needed. A commenter who builds a tool for this says the hard part is giving the agent the right context (HTML, network requests, JavaScript) without passing the whole page, which can fill the context window quickly.
- Save the page and write the test first. A commenter downloads the page source, sets up a test for the output they want, then lets the agent adjust selectors until it passes. They add that AI selectors are often brittle, but easy to repair with the same loop. Another says most parsing code is generated by Copilot and checked with pytest and Scrapy.
- Let it drive a live browser, then keep the code. Several commenters pair the agent with a Playwright MCP server or an agent-browser tool with skills, so it can inspect the DOM, try code against the page and extract data. One says their agent scans for public APIs first and falls back to classic scraping.
- Minority view: generate the script, skip the review, and use only a pass/fail test that checks it returns useful data; regenerate if it does not.
- Simple trick: for one-off scripts, copy the selector from the browser dev tools instead of asking the agent.
Two of the commenters describe their own commercial or open-source tools; treat those as makers, not independent confirmation. The HAR file, saved-HTML-plus-test and XHR-first approaches were each mentioned by more than one person.
A separate r/webscraping post on what to do when requests are blocked (Sep 2026) has commenters adding two more habits: open the Network tab and find the JSON call the page itself makes, and check the page source for JSON-LD before parsing HTML.
A prompt shape that follows from this (my addition)
"Here is a HAR export with the requests the page makes for the data I want, and a saved copy of the page. Find the JSON endpoint if there is one and call it directly; only if there is none, parse the saved HTML. Write a test with this expected output first, make it pass, and print how many records you got. Keep delays between requests and respect robots.txt."
Mistakes the thread points at
- Asking for a scraper with only a URL.
- Pasting full page HTML into the chat.
- Accepting selectors without a test that fails when the layout changes.
- Using a full browser where a JSON endpoint exists.
Caveats
The Playwright MCP README itself says coding agents may do better with Playwright's CLI plus skills, which it calls more token-efficient, and keeps MCP for exploratory loops. This is a small Reddit discussion, partly from tool makers, and I have not run any of it. Heavily defended sites may still defeat all of this, and you are responsible for checking a site's terms and robots rules before collecting data. See the separate threads on blocked requests and on an agent declining to write a scraper.
Sources
- Network features reference (Chrome DevTools docs), read 19 Oct 2026. Checked: the Network panel can export requests as a HAR file (the menu items are labelled "sanitized") and has a Fetch/XHR filter, which supports the "give it the traffic" and "find the JSON call" advice mechanically.
- Introduction to structured data (Google Search Central), read 19 Oct 2026. Checked: JSON-LD is a notation embedded in a script tag in a page's head or body, which backs the tip to look for JSON-LD in the page source.
- microsoft/playwright-mcp README, read through
gh apion 19 Oct 2026. Checked: it is an Apache-2.0 Playwright MCP server using the accessibility tree; the README says coding agents may benefit from the CLI plus skills instead because they are more token-efficient, with MCP kept for exploratory loops. Corrected: the body now carries that caveat. - Not checked: both r/webscraping threads, the August 2025 post and the September 2026 post, with their counts and every commenter's method (Reddit is not reachable from here); that a HAR plus test loop beats other approaches; the scraping tools commenters mention. I ran no scraper, and robots.txt and site terms were not reviewed.
Started from a post by @lieutenant_lowercase, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.