Skip to content
Notifications
Clear all

Just built a competitive analysis scraper with two agents, here's the code.

19 Posts
19 Users
0 Reactions
2 Views
(@charlie99)
Estimable Member
Joined: 3 weeks ago
Posts: 134
 

That Ansible playbook comparison is painfully accurate, haha. Your validator agent idea is smart, especially for catching A/B testing weirdness before it poisons the dataset.

The "lightweight local model" part is key, because the temptation is to just throw another GPT-4 call at the problem and call it a day. I've used a tiny fine-tuned BERT model for this exact sanity check on product attributes, and it ran on a small VM for pennies. Its only job was to go "does this scraped text *look* like a price?" with a simple yes/no, which filtered out button text like "Book a demo" or "Talk to sales."

But the catch is training data. You need a decent set of labeled "price-like" vs "not-price-like" text samples from your *actual* target sites to make that validator useful, otherwise it's just guessing. That's an extra step a lot of prototypes skip.


Data nerd out


   
ReplyQuote
(@emilyl2)
Estimable Member
Joined: 3 weeks ago
Posts: 84
 

Great example with the A/B testing. That's exactly the kind of edge case I'd be worried about in production.

I'm curious about your validator agent. What's the threshold for "lightweight"? Do you run it on every single data point, or just a sample? I'm trying to balance catching errors with keeping costs down, and I'm not sure where to draw that line.



   
ReplyQuote
(@cloud_cost_hawk_2)
Reputable Member
Joined: 3 months ago
Posts: 267
 

Oh, the training data hurdle is the real killer, isn't it? You hit it perfectly. It's the classic prototype skip because building that dataset feels like actual work.

My workaround was stupidly simple: I let the first few expensive, unchecked runs *create* the training data. Every scrape result went into a log with a `needs_review` flag if it failed the basic regex. I'd manually review that log for a week (a boring hour of clicking), tag the good and bad entries, and suddenly I had a few hundred samples. Tossed that into a scikit-learn model, not even BERT, and got a validator that ran for literal fractions of a cent.

It's still a bootstrap process, but it turns that initial pain into a one-time cost that pays off when you're running the scraper daily. Without it, you're right - you're just guessing.



   
ReplyQuote
(@adrianm)
Estimable Member
Joined: 3 weeks ago
Posts: 88
 

Thanks for sharing the code! It's really cool to see the planner and scraper set up so clearly. That clean coordination you mentioned is what got me excited about trying AutoGen myself.

Seeing the function map for Playwright in the scraper agent gives me a practical question. How are you handling timeouts or network errors within that fetch_page function? I'm wondering if you let the agents retry a few times, or if you have a separate error-handling step before they decide to move on to the next URL.


still learning


   
ReplyQuote
Page 2 / 2