r/WebForAI • u/Less-Mistake-3664 • 28d ago
Question My agent thinks that block pages are real content, how to avoid it?
First of all, I spent a good amount of time dealing with this exact problem on the research scraper. I’ve been running an autonomous research agent for a few weeks that basically fetches URLs, scrapes the text, and gives it straight to an LLM to summarize. At first it worked great or so I thought, until I noticed some answers were completely bs. Turns out a bunch of target sites were returning HTTP 200 OK with a Cloudflare verify you are human disclaimer, a captcha, or sometimes a massive cookie consent wall. The fetch tool blindly passed that text into context, and the model happily without any questions hallucinated an entire analysis based on the block screen. At one point, the agent confidently reported that a SaaS company's core feature was "requiring users to verify browser settings before continuing." Pretty funny until let's say an executive actually reads it. Also, a 403 or 429 is easy to catch and retry, but a fake 200 just slips downstream unnoticed. I just can't understand why that happens. I’ve tried a couple of fixes with mixed results: The first one - content length threshold: it essentially catches some spams, but also elimitaes legitimately short pages or quick announcement posts. LLM verification pass (Is this a real article or a bots?): Works okay, but it doubles API costs and smaller models still miss sneaky disclaimers. For people who are scraping a few thousand pages a day with agents: how are you handling this pre-LLM? I could use the second method of course, but I don't want to spend extra on the tokens plus it has some issues as mentioned. Tell me there is a solutions 😭
1
u/CapMonster1 26d ago
I'd handle this before passing content to the LLM by adding a separate response validation stage. HTTP status alone isn't enough: check page titles, common phrases like "verify you are human", captcha elements, and DOM structure. This should catch many block pages even when the server returns 200 OK.
It's also useful to validate whether the extracted content matches the expected page type. For example, if you're requesting an article but get a verification form or cookie wall instead of a title and body text, mark the result as invalid rather than sending it to the agent for analysis