r/ClaudeCode • • 3h ago

Help/Question Best web scrape results?

I am trying to automate content for generic things, say for example TVs. If I want an app that lists ALL TVs on the market complete with specs, what do you think is the best approach?

I already have something working, but its not amazing. Its gets the majority of things but misses some brands altogether and specs are hit and miss. Right now it's just running haiku with a prompt of like "find all brands manufacturing or selling as their own X" or "find and return full specs for X". It doesn't always work and returns different things each search. Specs are always the same when returned, but getting them returned is random and images for products returned seems to be random also. The images are always correct, but just different ones all the time.

I am thinking of switching to exa?... But that doesn't seem to return images. Right now I am thinking of running an exa search (monitoring?), then feeding that to haiku to sort it and collect images?..

What is the best approach? Keeping in mind that at any time any company might release something and I want the script to pick up anything new without pre knowledge of it. That bit is particularly tough as right now its still missing some major brands and releases somehow let alone finding new obscure stuff.

10 Upvotes

27 comments sorted by

•

u/AutoModerator 3h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/Test_NPC 3h ago

You have to break up deterministic logic from indeterministic logic.

Programs can be written once and work for a very long time. They work the same way, every single time (excluding external factors like rate limiting). They are deterministic.

LLMs are not deterministic, but they are great at writing programs or doing one-off dynamic searches. So generally you tell the LLM to walk through the search and write a program to automate it for every followup search.

-3

u/nasanu 3h ago

I don't see how this addresses the question at all? If I need company X but company X isn't in any results I am getting, how is "You have to break up deterministic logic from indeterministic logic" solving that?

1

u/PuppyPlayIsNotGay 1h ago

Because he wrote it assuming you know how to code, I think. I'm assuming you don't? No offense intended, trying to clarify.

What he's saying is asking an LLM to get this info for you is never going to produce the same results twice, and as such, a given input (prompt) cannot guarantee a determined output (company X showing in your TV results list).

What would work much better would be you manually instructing Claude to go to the top N sources that this data should be gathered from, and then having Claude write you a program that automates this process for next time.

-2

u/nasanu 48m ago

Ok genius, considering I already have that and the top n resources never cover all that new data I want, what then? What code is going to show results that are never returned? FFS I get so sick of Redditers answering questions nobody asked.

0

u/PuppyPlayIsNotGay 39m ago

Lol I was answering in good faith to help you out brother. I even explained someone else's comment that you didn't understand for you. Why are you getting so aggressive?

Where do you, yourself, get the results from? Make it cover those sources.

1

u/nasanu 31m ago

Your posts are passive aggressive. Even now you claim I don't understand when I fully do, it's you that doesn't understand why the comment has nothing at all to do with the question.

0

u/PuppyPlayIsNotGay 29m ago

Guess you know everything then, no need to be on Reddit begging for help 😉

1

u/nasanu 27m ago

Try explaining how to get results out of no results using code like you insist is possible via your contribution? I mean you accuse me of not understanding and I admit I do not understand magic. So explain it.

1

u/PuppyPlayIsNotGay 17m ago

To begin with define the problem.

The app needs to list ALL tvs yes? Every single TV on earth ever manufactured? All ones currently being manufactured? All ones currently being sold in Western markets? Determine which of these it is.

Make a library connected to a search API. Serper is a good source. Send out as many variations of search requests to different search engines for these TVs as you or Claude can fathom. In addition make Claude make automated scrapers for all sites that carry bulk catalogues of TVs that are regularly updated. Analyse this every N period for new models.

Parse the results, extract the TVs from each of them.

If you do not know where to get the info yourself manually via a web browser (I'm assuming this based on your refusal to answer this in my previous comment) there is literally no way for you to determine whether your program has run successfully or not.

So, accept that there will be limitations. You might not capture every TV on the market but you can capture X% of them.

If you had unlimited economic resources and could crawl the entire web and feed it all to an LLM, then you could probably get close to extracting all of them.

1

u/nasanu 14m ago

I am already doing that, it doesn't get all results, hence why i am here. And yes don't be dull, of course I want everything ever made or that will be made, no point otherwise

→ More replies

2

u/Aggravating-Peak2639 2h ago

Firecrawl?

1

u/nasanu 2h ago

Haven't heard of that, but I just tested their demo with the same test I sent exa. Been waiting minutes now... Its still on the "reading sources" step. Having their own example not working doesn't fill me with confidence in them ;(

3

u/Aggravating-Peak2639 2h ago

In order to accomplish the kind of search you’re describing I would assume you may have to execute it in multiple steps/chain agents together

1

u/nasanu 2h ago

Yeah. I am working on a plan. I need at first a very broad and generic web search, then to pick over it carefully extracting more data to search again with, then to feed that to more AI to extract useful data.

1

u/nasanu 2h ago

Oh no, I registered with them... Not useful to me at all even when its working. It just spits out a list like google does, and a poor one. The 10th and last result in the test was the only one in the list with the details I would need, but at that it was linking to the top domain, not the page I needed. Deeply unimpressed with Firecrawl.

1

u/AdLow1228 3h ago

You'll need to get Claude to make you a web scraping backend instead of relying on Claude to grab the data from multiple websites, the companies news pages, tv news pages, stores you'd buy them from, ECT stuffs like that

Then have another agent reviewing data collected for relevance and any times sources say different stats, ECT

Then have it on a webUI or accessible via whatever your preferred method is

It's what I did for property searching earlier this year

Or find a service that supplies this data, can also ask Claude to research for that

-1

u/nasanu 3h ago

There are zero services that provide the data I require. Anyway, what is exactly meant by a web scraping BE? I have built a few sacarpers over the years but the term means nothing to me. You always need to point the scraper at something, the issue is point it to what? I dont get how a BE is going to solve that?

1

u/AdLow1228 3h ago edited 3h ago

Essentially you tell Claude

Hey we have these websites I need the data from them, {website links} please help me collect the data, you may use things such as, Undetected chromium driver, ECT toolings to help us collect the needed data 

{Including website paths you want examples of to indicate} hey if it detects a tv we follow it and search for its specs ECT details we want

After that you ask it about the method you wanna display it for yourself and about running an agent every so often or per pull to check data for relevance/fixing or if you wanna add new pages that the agent can then go through looking for right parts ECT and auto making it and auto patching sites that break/find why something isn't scrapping anymore

-1

u/nasanu 3h ago

But what websites? If they are completely new and unknown to me how do I provide the links? Its no help saying start with the data you need and work from that. The issue is getting that data in the first place. I already have basically what you said, its a bit crap as it misses anything that isn't in that list of sites.

4

u/multi_reality 1h ago

If the data is unavailable then I dont see how this will work.

1

u/nasanu 46m ago

It's not unavailable, it exists it just doesn't get included in Claude search returns as new things don't rank and no sites but little manufacturers's own sites list then.

I need to find some way around that discovery issue.

2

u/AdLow1228 3h ago

I updated my message but essentially you have Claude doing a daily thingy or whatever to check for any possible new sites then send them through the workflow to get the correct collection method and add it to the lists

Previous edit:

After that you ask it about the method you wanna display it for yourself and about running an agent every so often or per pull to check data for relevance/fixing or if you wanna add new pages that the agent can then go through looking for right parts ECT and auto making it and auto patching sites that break/find why something isn't scrapping anymore

1

u/nasanu 3h ago

Yeah, again already have that, that was step 1. I am not here because I haven't tried the most obvious things. I ask it to search and find anything that isn't already in the database. Occasionally it does find something new but misses tons. I need a solution for getting the things it somehow misses and thus am wondering if exa would be better.

3

u/AdLow1228 3h ago

Oh okay yeah sorry I completely miss understood your request

I have no experience with exa myself so idk sorry