Automate Browser AI: Delegating Article Drafts to Free Qwen Chat
Building a free article draft generator from chat.qwen.ai via automated browser: mechanics, pitfalls, and fallback that make it cron-worthy.
The article you are reading was generated by the very tool it discusses. Cost is zero: drafts are delegated to the chat.qwen.ai web interface, run by an automated browser on your own server. The main generator in this blog pipeline already runs on a local model; the Qwen path is a free second engine, using the Plus model, with its own web search.
Why bother with a second path
The reason is diversification. If the local model is busy or the brief needs a different perspective, free web chat is a backup that adds no cost. The Qwen3.7-Plus model on the free account also actively searches the web, so returned drafts sometimes already come with references. The consequence is clear: no API, no integration documentation. All communication goes through the UI, and the UI changes without notice.
Mechanics: from prompt to markdown
The browser used is Camofox, an anti-detect Firefox whose profile stores login sessions, so there is no account sign-in process at each execution. The prompt sent can be tens of thousands of characters: a complete SEO template plus topic context from research. The Qwen editor swallows the Enter key, so submission is done by clicking the Send button, and UI element references are fetched fresh from the accessibility snapshot each time action is needed.
Waiting for the answer is the trickiest part. Long answers appear as a numbered-line code window that cannot be read raw from the page snapshot. The solution is actually a built-in UI feature: click the Copy button in that code window, read the clipboard, and the raw markdown comes back intact. Complete with the ===SELESAI=== marker line that confirms generation is truly finished, not truncated.
Three time-wasting pitfalls
- Echo prompt. The sent prompt gets read back as a user bubble and briefly mixes into extraction results. The filter now discards any block containing the prompt opening.
- Race condition on completion. The completion indicator in the UI can appear before the answer is fully rendered. An explicit marker from the prompt resolves this ambiguity: done means
===SELESAI===has been seen. - Drafts that ask back. Sometimes Qwen offers two versions then waits for confirmation. The prompt contract now forbids this, and if it still happens, an automatic follow-up instructs it to write the final version immediately.
Results in the real pipeline
This tool is now the --engine qwen option in the article generator command, with the local model remaining as default. The hourly cron job tries Qwen first; if it fails, whether from quota or UI changes, it falls back to the local model and logs the reason. Four consecutive tests in the development session passed: 12,000-character context payloads processed, drafts ranging from 1,300 to 2,600 words, each completing within about three minutes.
FAQ
Does this violate terms of service? The free quota does have its rules, and usage here is one or two prompts per cycle, not mass spam. Still prepare fallback because access can be restricted by the provider at any time.
Why not use the official API? The API is more stable, but paid or with tight rate limits on the free tier. The UI path leverages existing chat quota, with the trade-off of script maintenance when the UI changes.
What if the UI changes suddenly? That is the biggest risk. That is why the parser does not depend on a single selector: completion is detected from a text marker, extraction is layered from snapshot to clipboard, and fallback to the local model is mandatory.
Closing
This combination of a free chat interface and automated browser is a cheap second engine for a content pipeline. Its status is indeed a secondary path: its reliability depends on scripts that are defensive against UI changes. Start small, install strong fallback, and let the machine fill drafts while focus stays on editing and strategy.