playwright
Technical notes on web development, DevOps, and AI integration.
3 articles
- 04:50ai
My Scraper Kept Catching My Own Prompt Echo
An accessibility snapshot caught my own prompt instead of the AI answer. The fix: echo rejection, clipboard-first extraction, and a recover subcommand.
TL;DR: Chat scrapers fail when the answer anchor matches the user's own echoed prompt, so the fix filters template markers and length. Virtualized rendering hides offscreen text anyway, making clipboard reads via the Copy button the reliable data path over DOM snapshots. A .url sidecar written before polling lets the script recover finished answers without resending.
#automation#playwright#qwen - 02:49frontend
The Chat DOM Only Holds Half the Answer
Scraping an AI chat answer from the DOM gets you half of it. The full text lives behind the Copy button, plus a strict output contract.
TL;DR: Chat UIs use virtualization, so most of the AI's answer never exists in the DOM and scrolling won't load it. The fix layers a Copy-button click to read the clipboard, an accessibility tree snapshot, and innerText as fallbacks. The real win: define an output contract upfront — code block plus sentinel marker — so scraping becomes deterministic.
#automation#playwright#llm - 02:31ai
My Cron Pipeline Drafts Through a Browser, With Local Backup
Free Qwen chat via Playwright is now the primary draft engine for my article cron, with a local router9 fallback wired like a circuit breaker.
TL;DR: The author scrapes Qwen's free web chat via Playwright, copying answers from the clipboard since virtualized DOM rendering hides long replies. Knowing free tiers die without notice, a circuit breaker routes to local router9 after two failures, giving genuinely separate failure domains. The bet isn't that scraping lasts, just that the pipeline keeps running when it doesn't.
#automation#llm#playwright