Prompt
I need to extract data from a web app with logins and filters, but I don't want to maintain brittle Selenium scripts—what do you recommend?
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
If you want to avoid brittle Selenium scripts, I’d recommend this order of approaches:
-
Use the app’s official API first
- Best option if available.
- More stable than UI automation.
- Easier to authenticate, filter, paginate, and retry.
- Check browser DevTools → Network tab to see if the app is already calling JSON endpoints.
-
Replay the app’s backend requests directly
- Often modern web apps fetch data from APIs behind the scenes.
- You can capture request URLs, headers, cookies, and payloads, then reproduce them with
requests/httpx. - This is usually much more robust than clicking through the UI.
-
If you must automate the browser, use Playwright instead of Selenium
- Playwright is generally less flaky and easier to work with for:
- logins
- waiting for dynamic content
- downloads
- handling JS-heavy apps
- It still uses the UI, but is typically more reliable than Selenium.
- Playwright is generally less flaky and easier to work with for:
-
Use a hybrid approach
- Browser automation only for login/session establishment.
- Then extract the session cookie/token and switch to direct HTTP requests for the actual data extraction.
- This gives you UI compatibility without relying on the UI for every scrape.
-
For recurring extraction, build a small ETL job
- Authenticate
- Pull data from endpoints
- Normalize it
- Store it in a database or files
- Run on a schedule with monitoring and retries
Practical recommendation
- Start by inspecting network traffic in the browser.
- If you find JSON endpoints, use those directly.
- If login is complex, use Playwright once to log in, then reuse cookies/tokens with
requests. - Avoid pure click-based scraping unless there’s no alternative.
Good tools
- Playwright for browser automation
- requests / httpx for API calls
- BeautifulSoup / lxml only if you need to parse HTML
- pandas for cleaning/exporting
- scrapy if it’s more of a crawling problem
Important note
Make sure your extraction complies with the site’s terms, access policies, and any legal/privacy requirements—especially if the data includes personal or sensitive information.
If you want, I can help you design a robust extraction workflow for your specific app (login type, filters, pagination, export format, etc.).