Prompt
How do I automate form filling in a web app without a reliable API?
Latest observation
Nov 6, 2026
OpenAI APIWeb search: off
If there’s no reliable API, the usual options are:
-
Browser automation
- Use tools like Playwright, Selenium, or Puppeteer to control the web app like a user.
- Best when the app is browser-based and you can log in normally.
- You can script:
- navigation
- typing into fields
- clicking buttons
- waiting for page loads
- reading validation messages
-
RPA tools
- Use UiPath, Power Automate, Automation Anywhere, etc.
- Good if you need a more “no-code/low-code” approach or have to automate across multiple apps.
-
Direct DOM interaction via extensions or injected scripts
- If you control the environment, a browser extension or userscript can fill forms directly.
- Useful for internal tools where you want lightweight automation.
-
Headless scraping + form submission
- Sometimes you can inspect the network requests and mimic them directly with HTTP calls, even without an official API.
- This is more fragile, but can be faster than driving the UI.
Recommended approach
For most cases, start with Playwright:
- more reliable than older Selenium setups
- handles dynamic pages well
- good waiting mechanisms
- supports Chromium, Firefox, and WebKit
Example in Playwright (Node.js)
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://example.com/login');
await page.fill('#username', 'myuser');
await page.fill('#password', 'mypassword');
await page.click('button[type="submit"]');
await page.waitForLoadState('networkidle');
await page.goto('https://example.com/form');
await page.fill('input[name="firstName"]', 'Alice');
await page.fill('input[name="lastName"]', 'Smith');
await page.click('button[type="submit"]');
Practical tips
- Prefer stable selectors:
name,data-testid,aria-label- avoid fragile CSS paths or text-only selectors when possible
- Add explicit waits for elements that appear after async loading
- Handle:
- CAPTCHAs
- 2FA
- popups/modals
- file uploads
- validation errors
- Use a test account and a staging environment if possible
- Log actions and failures so you can recover from partial submission
When to avoid browser automation
Browser automation may not be ideal if:
- the app changes often
- there’s heavy CAPTCHA/anti-bot protection
- the workflow is very high volume and needs strong reliability
- you need to integrate with systems that already expose internal endpoints
If you want, I can show you:
- a Playwright script for your specific form
- a Selenium version
- or a strategy to reverse-engineer the network requests safely.