r/ClaudeCode • • 1d 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.

14 Upvotes

41 comments sorted by

•

u/AutoModerator 1d 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.

4

u/rbatista191 1d ago

exa won't fix the missing brands. it searches by meaning over its own index, and in our test of 500 queries its top 10 shared only 32% of urls with google's. it also returns none of google's shopping units, which is where products show up with images and prices. google showed one on 14% of those queries, and brave, tavily and perplexity returned none either.

for "every tv on the market" I'd stop asking an llm to discover. pull google shopping results through a serp api (serpapi, oxylabs and cloro all return them) plus a few big retailers' category pages, dedupe on model number, and use haiku only to clean up specs.

for new releases, run a daily news query per brand and diff against your list.

0

u/nasanu 1d ago

That's the issue, it's not actually TV's but more boutique products and big retailers don't stock them, nor can I find any serp API with them. I will keep looking but maybe I'll have to resort to manually adding things every now and then. I think what I am doing is too niche.

2

u/Aggravating-Peak2639 1d ago

Firecrawl?

1

u/nasanu 1d 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 1d 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 1d 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 1d 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.

2

u/veganwurst 1d ago

The randomness is the clue: you're asking a model to search and remember in one step, so each run samples a different slice of the web. I'd split it into three jobs that each have a fixed answer:

  1. A source list. Brands, plus the sites that sell them: brand sites, the specialist stores that carry boutique products, distributors. Haiku or Exa is fine for finding candidates for that list, but store the result and review it instead of rediscovering everything each run. Re-run discovery weekly to add new brands.
  2. A full catalog pull per source. For each brand or store site, take the whole product list from its sitemap or category pages on every run, not through search. New products then show up because they're in the site's own catalog, not because a search happened to return them. Diff against the last run and you have your "new release" feed.
  3. Specs and images from the product page. Parse each page with a fixed parser per site (an LLM can write it once), so the same page always gives the same specs and the same image URLs. Use the LLM afterwards only to line up spec names across sites ("Screen size" vs "Diagonal").

The "always correct but different images" problem goes away too once you take the images from the product page itself instead of from a search result.

I work at DeepScout, which does steps 2 and 3 for online stores: you give it a store URL and get every product with specs and images in one schema, and you can drive it from Claude Code over MCP. It won't do step 1, finding brands you don't know about yet is still a search problem. In case it's useful: exporting a store's whole catalog

0

u/nasanu 1d ago edited 1d ago

I already do, I am not sure why people keep assuming the most obvious step wasn't done in the first 30 seconds of making the site. I have one button that fires off workers in sequence. It first checks search (claude) for all brands it can find (via a general search and specific sites), then checks them against what is already in the DB, if not found adds them, then for each brand it searches out all products for that brand via their official sites or whatever other sources it can find and same deal, checks and adds. Then once all products are found it then goes to find specs for all products (new products or products with missing specs), usually off the official site.

The issue is that even just getting specs from the very page they are on sometimes doesn't come back with anything, and I can see the page claude is checking. Then I'll press the button again and it will contact the exact same site, exact same page and suddenly find specs. But the main part is that there are zero lists of products on aggregation sites I know of that cover everything, even combined. Some brands I get to know via social media, random mentions here and there, they are never on lists on sites and never in 3rd party stores. I can add those manually, but I need a way of automating that discovery. Thus I was wondering if exa monitoring for a generic search would be the best solution but so far I cant find anyone who has experience above the basics which you covered.

Anyway here is a vid for basically everyone saying no you are 100% lying you can't code at all and dont even know what an app is. Oh I forgot to tick the brand check but you get the idea:

1

u/mkotsollaris 23h ago

Since the specs come back fine once it finds a product, i'd stop asking the model to discover products at all and treat it as a crawl. Boutique brands almost always have their own store, and a lot of them run on Shopify, so /products.json plus the sitemap gives you the whole catalog with images in one go, no search needed. For the non Shopify ones the product pages usually carry schema.org Product JSON-LD, and if you take the image from there (or og:image) you get the same one every run instead of whatever haiku grabs. How are you finding the brands in the first place, retailer lists or just search?

1

u/nasanu 23h ago

No, the specs do not come back fine. They sometimes do, sometimes dont from the same url, same model, same prompt just 15 seconds apart. When I get credits again I will mess with the prompt, right now I have one prompt for all specs like search the page for these, return them if found, going to alter it per product/brand to be more specific. Maybe that will help.

But no, most shops do not have shopify, a few do but not most.

Finding brands is the hard part. A ton of them, especially out of China just start appearing on places like here or facebook, get a few mentions on forums etc. There is no site listing them or paid solution, which is likely the sole reason that nobody has done this before as far as I can tell. Initially I got claude to make a general search, from there got as many specific sites as I could and added all the brands I could. I still do a general search like the first time but I never find anything anymore, even though sometimes I get products returned from new manufactures. How the hell it finds a product from a manufacturer without finding the manufacturer is anyone's guess, but Ill tackle it again tomorrow.

1

u/IllustriousSalad6201 21h ago

your clarification about boutique products changes this quite a bit. a search result list can miss a whole manufacturer without telling you anything is missing. i'd keep a separate manufacturer directory, adding candidates from niche publications and trade-show exhibitor lists, then monitor each confirmed manufacturer's catalogue. keep the source page attached to every spec, and select the main image from that product page consistently. you still won't prove completeness, but you'll know which brands you actually checked.

1

u/nasanu 12h ago

Pretty much exactly what I started with. I am going to play with the prompt wording today though, see if I can get an initial broader search for brands. I have also noticed strangely that though I see claude getting manufacturer sitemaps and it has the full product list (tough for second hand products not on manufacturer lists), sometimes it's just skipping products, and those products can be in between products it will report back with. I need to figure that out but its perplexing. A sitemap has a list of products, it takes products 1-3 in the list, skips no4 and completes it with 5-7.... Weird. Will be a day of tinkering and seeing what's what.

1

u/AdLow1228 1d 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 1d 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 1d ago edited 1d 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 1d 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.

5

u/multi_reality 1d ago

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

1

u/nasanu 1d 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 1d 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 1d 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.

4

u/AdLow1228 1d ago

Oh okay yeah sorry I completely miss understood your request

I have no experience with exa myself so idk sorry

1

u/Test_NPC 1d 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.

-6

u/nasanu 1d 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 1d ago edited 1d ago

Because he wrote it assuming you know how to code, I think. I'm assuming you don't? No offense intended, it will help me explain how to approach it if I know whether you have a software background or not.

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.

-9

u/nasanu 1d 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.

1

u/PuppyPlayIsNotGay 1d ago edited 1d ago

Lol I was answering in good faith to help you out brother. Why are you getting so aggressive?

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

-4

u/nasanu 1d 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.

1

u/PuppyPlayIsNotGay 1d ago

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

-2

u/nasanu 1d 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.

2

u/PuppyPlayIsNotGay 1d 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 1d 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

1

u/UnfocusedAcrobat 1d ago

Read all your comments in this thread, you may be the most insufferable redditor I’ve come across this year. Multiple people are giving you good advice and you’re too dense to listen to them. Good luck in your scraping when you don’t even know what websites to scrape. 

-1

u/nasanu 1d ago

Cool story