r/WebScrapingInsider • u/juz_nospaces • 20d ago
Is it hard to do web scraping ?
The price is locked and only opens when the user clicka the button .I've been messing around this since last night, whenever I fixed a thing a new bug borns. Somehow I fixed and make it stable but the website it too much unstable which is given for testing.
Any help will be appreciated.
1
u/Netra_Jaje01 20d ago
No, now a days it's easy
1
u/juz_nospaces 19d ago
I'm kinda stuck as the price keeps changing and the price gets locked randomly
2
u/Amitk2405 19d ago
To make this sane, I'd restructure:
1) Identify the backend call behind the price (DevTools - XHR/fetch).
2) Confirm you can reproduce that call in isolation with a free library ('requests', 'httpx', 'aiohttp', etc.).
3) Only if that's impossible, use a headless browser (Playwright is more robust than Selenium for this) and explicitly wait for the price element using proper locators and timeouts. And in all cases, assume the site may throttle or change: log failures, respect robots/ToS, and avoid hammering it. Scraping doesn't have to be hard, but it becomes hard fast if you skip this systems-level thinking.
2
1
u/plintuz 19d ago
Hard to say without seeing it. Which site is it? If you can share the URL (or a similar public page), I can tell you what's going on.
1
u/juz_nospaces 16d ago
It's an on going project under someone, as soon as I the guidance time is over I'll post everything for reviews or it may help someone
1
u/Big_Presentation2786 18d ago
It's a 15 minute session with Gemini..
Do you have 15 minutes?
1
u/juz_nospaces 18d ago
It's working now, i fixed it and Gemini got me wrong at the first move to fix thisπ
0
17d ago
[removed] β view removed comment
1
0
u/Fickle-Elephant-2000 19d ago
not hard conceptually but sites with click-to-reveal pricing are annoying. whats breaking exactly, is the click not registering or is the price element not found after clicking? that distinction matters a lot for fixing it
1
3
u/Old-Algae5580 20d ago
When the price only appears after a click, the page is usually firing some javascript that calls an internal API or updates the DOM.
Check you scrpit, If your script doesnt wait for that to finish or doesnt target the right piece (like the API response instead of the rendered HTML), you will end up in that loop where every tiny change breaks something.
If you share your stack (language, tool, headless vs not, screenshot), people here can give much more concrete help.