Prompt
What should I use for browser scraping that won't break every week?
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
If you want browser scraping that’s less likely to break every week, the main thing is to use a stack that’s maintained, well-supported, and resilient to minor site changes.
Best practical choice
Playwright is usually the best default today.
Why:
- Actively maintained
- Works well with modern JS-heavy sites
- More reliable than older browser automation tools in many cases
- Good support for:
- waiting for elements properly
- handling navigation
- multiple browsers
- headless/headful modes
- Better ergonomics than Selenium for many scraping workflows
Good alternative
Selenium is still fine if:
- your team already knows it
- you need compatibility with existing tooling
- you’re scraping simpler sites or using an established grid setup
But in many cases, Selenium tends to feel more brittle and slower to adapt than Playwright for modern sites.
If your goal is durability, not just tooling
Even the best browser tool will break if you scrape by fragile selectors like:
- long CSS chains
- dynamic class names
- text that changes often
- exact DOM structure assumptions
To make scraping last longer:
- Prefer stable attributes:
data-testidaria-labelname- semantic tags
- Avoid depending on auto-generated classes
- Build retries and fallback selectors
- Add monitoring so you know when pages change
- Save HTML snapshots for debugging
- Separate “fetching” from “parsing” so parser changes are easy to patch
Best “won’t break every week” strategy
A more stable approach than full browser automation is:
- Inspect network calls
- Use the site’s underlying API endpoints if possible
- Use browser automation only when needed
This is often far more stable than scraping rendered DOM.
Recommended stack
- Playwright for browser automation
- Requests/httpx for direct HTTP calls where possible
- BeautifulSoup / lxml / parsel for parsing HTML
- A scheduler + monitoring for alerting on failures
If you want maximum resilience
Use:
- Playwright
- explicit waits
- stable selectors
- network/API harvesting when possible
- alerts + tests against sample pages
Short answer
If you want one tool to start with: Playwright.
If you want, I can also give you:
- a Playwright scraping template
- a selector strategy that survives site changes
- or a comparison of Playwright vs Selenium for scraping