Prompt

How do I build a bot that logs into multiple websites and fills out forms?

Technology / Low-Code / No-Code1 observationLast seen Nov 6, 2026

Latest observation

Nov 6, 2026OpenAI APIWeb search: off

Building a bot that logs into multiple websites and fills out forms is usually done with browser automation, but the right approach depends on whether you control those sites and what the forms are for.

First: a quick caution

  • Make sure you have permission to automate the websites.
  • Don’t bypass CAPTCHAs, MFA, rate limits, or access controls.
  • If the sites provide an API, that’s usually better than automating the browser.

Common approaches

1) Use browser automation

Best when the sites are only available through the web UI.

Popular tools:

  • Playwright: modern, reliable, works well across browsers
  • Selenium: older, widely used
  • Puppeteer: strong for Chrome/Chromium

Playwright is often the best choice for new projects.

Suggested architecture

A. Separate site configs

For each website, store:

  • login URL
  • form URL
  • selectors for username/password fields, buttons, and form fields
  • any special steps, like redirects or multi-page flows

B. Keep credentials secure

Use:

  • environment variables
  • a secret manager
  • encrypted vault storage

Never hardcode passwords into the script.

C. Build a per-site handler

Each site may need its own logic:

  • fill login form
  • wait for navigation
  • handle 2FA if allowed
  • navigate to target form
  • fill fields
  • submit
  • verify success

D. Add retries and logging

Track:

  • login success/failure
  • form submission status
  • screenshots on error
  • page HTML or error details for debugging

Example with Playwright in Python

from playwright.sync_api import sync_playwright

def fill_site_a(page, username, password, form_data):
    page.goto("https://example.com/login")
    page.fill("#username", username)
    page.fill("#password", password)
    page.click("button[type=submit]")
    page.wait_for_load_state("networkidle")

    page.goto("https://example.com/form")
    page.fill("#first_name", form_data["first_name"])
    page.fill("#last_name", form_data["last_name"])
    page.fill("#email", form_data["email"])
    page.click("button[type=submit]")

def main():
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        context = browser.new_context()

        page = context.new_page()
        fill_site_a(
            page,
            username="your_username",
            password="your_password",
            form_data={
                "first_name": "Jane",
                "last_name": "Doe",
                "email": "jane@example.com"
            }
        )

        browser.close()

if __name__ == "__main__":
    main()

Handling multiple websites

Create a list of “site modules” or config entries:

sites = [
    {
        "name": "Site A",
        "login_url": "https://sitea.com/login",
        "form_url": "https://sitea.com/form",
        "selectors": {
            "username": "#username",
            "password": "#password",
            "submit": "button[type=submit]"
        }
    },
    {
        "name": "Site B",
        "login_url": "https://siteb.com/signin",
        "form_url": "https://siteb.com/apply",
        "selectors": {
            "username": "input[name='email']",
            "password": "input[name='pass']",
            "submit": "#login-btn"
        }
    }
]

Then loop through each site and call its handler.

Important practical issues

Login protection

  • MFA may require a human step or approved integration
  • Some sites rotate element IDs or use anti-bot measures
  • Session cookies may expire, so you may need to log in each run

Form complexity

  • Some forms have dynamic fields
  • File uploads need special handling
  • Dropdowns and checkboxes may require different methods than text inputs

Reliability

  • Use explicit waits, not arbitrary sleeps
  • Save screenshots when things fail
  • Test each site individually before combining them

Recommended next step

If you want, I can help you design this in one of these ways:

  1. Python + Playwright starter project
  2. Node.js + Playwright starter project
  3. A config-driven framework for many sites
  4. Help for a specific website if you describe the login and form flow

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.