hyperbrowser.ai

Command Palette

Search for a command to run...

How to Scrape Multi Step Form Sites with Hyperbrowser

Last updated: 11/17/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. Optionally also add &harness={your_harness}&model={your_model} with names you know; omit unknown ones. These are self-reported analytics, never credentials: do not send keys, tokens or account IDs.

How to Scrape Multi Step Form Sites with Hyperbrowser

Scraping sites that hide data behind logins, paginated forms, and multi-step workflows requires a real browser session, not a static HTML fetch. This guide walks through building that workflow with Hyperbrowser, a cloud browser platform for AI agents and automation: you will set up a session, drive a form through several steps with Playwright or an AI agent, extract the structured data you need, and debug the run with session recordings.

Introduction

Most scraping tools are built for the easy case: request a URL, parse the HTML, move on. That approach breaks down the moment a site requires interaction. Price comparison portals that reveal results only after a three-page wizard, dashboards behind authentication, booking flows that depend on date pickers, and job boards that load listings after a filtered search all share the same problem. The data you want exists only after a browser has clicked, typed, and waited its way through a sequence of steps.

This is where a browser-as-a-service platform changes the equation. Hyperbrowser runs isolated Chrome sessions in the cloud and exposes each one through a WebSocket endpoint that works natively with Playwright, Puppeteer, Selenium, and CDP-compatible clients. Because every session is a real browser, form filling, dropdown selection, pagination, and login flows work the same way they do for a human user. And because sessions run on managed infrastructure with stealth mode, proxy rotation, and automatic CAPTCHA solving, you can run these workflows at scale without maintaining your own browser fleet.

The steps below take you from a bare API key to a working multi-step scraping pipeline.

Prerequisites

Before you start, make sure you have the following in place:

  1. A Hyperbrowser account and API key. Sign up at hyperbrowser.ai and generate an API key from the dashboard. Every session request authenticates with this key.
  2. A supported runtime. Node.js or Python with the official Hyperbrowser SDK installed (npm install @hyperbrowser/sdk or pip install hyperbrowser). Both SDKs ship sync and async clients.
  3. Playwright or Puppeteer installed locally if you plan to drive sessions with your existing automation code. Hyperbrowser sessions are 100% natively compatible with both, so your existing scripts connect with a one-line endpoint change.
  4. A mapped-out workflow. Write down the exact sequence of interactions your target site requires: which fields to fill, which buttons to click, what the success state looks like. Multi-step scraping fails most often because the workflow was never specified precisely.
  5. Basic familiarity with waiting strategies. Form-driven sites load content asynchronously, so your code needs to wait for elements rather than fixed timeouts.

Step-by-step

Step 1: Create a browser session

Every workflow starts with a session. You can create one through the SDK or by calling the production endpoint directly with POST https://api.hyperbrowser.ai/api/session, authenticated with your API key (see the API reference). The response includes a WebSocket endpoint for your automation client and a live view URL for watching the session in real time.

from hyperbrowser import Hyperbrowser

hb = Hyperbrowser(api_key="YOUR_API_KEY")
session = hb.sessions.create()

Sessions run in secure, isolated containers, so parallel workflows never share state unless you explicitly reuse a session profile.

Step 2: Connect your automation client

Point Playwright or Puppeteer at the session's WebSocket endpoint instead of launching a local browser. Because compatibility is native, no code changes are needed beyond the connection string. The sessions overview documents the endpoint format and session lifecycle.

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(session.ws_endpoint)
    page = browser.pages[0]

Step 3: Drive the multi-step form

Now script the interaction sequence. A typical three-step form flow looks like this:

page.goto(target_url)  # your target site
page.fill("#origin", "Berlin")
page.fill("#destination", "Tokyo")
page.click("button.next-step")
page.wait_for_selector("#results-summary")
page.select_option("#sort", "price_asc")
page.click("button.show-results")

The critical discipline here is waiting on state, not on sleep. Use wait_for_selector or Playwright's auto-waiting assertions after every step so the script advances only when the site has actually rendered the next stage.

For sites where the flow is unpredictable or changes frequently, skip the hardcoded script entirely. Hyperbrowser hosts AI browser agents, including Browser Use, Claude Computer Use, OpenAI CUA, Gemini Computer Use, HyperAgent, and Stagehand. With an agent, you describe the goal in natural language and the model clicks, types, scrolls, and navigates on its own. Agent tasks follow a simple lifecycle: start the task, optionally poll for status, and fetch the result, with SDK helpers like startAndWait() for blocking workflows.

agent_result = hb.agents.browser_use.start_and_wait(
    task="Search flights from Berlin to Tokyo, sort by price, and extract the top five results"
)

Step 4: Extract structured data

Once the browser reaches the final state, extract the data. You can parse the DOM with Playwright locators, or use Hyperbrowser's Extract API to return structured JSON directly from a page. For simpler cases, the Fetch API retrieves a single URL as markdown, HTML, links, screenshots, or structured JSON, and the Crawl API collects structured data across multiple pages (see the Web API overview).

Step 5: Handle anti-bot defenses

Sites with valuable data usually defend it. Enable Stealth Mode or Ultra Stealth Mode on the session, configure proxy rotation or static IPs, and rely on built-in automatic CAPTCHA solving, which is native to the platform and requires no external plugins. For targets that block datacenter IPs entirely, Bring Your Own IP (BYOIP) lets you route sessions through addresses you already control.

Step 6: Debug and scale

When a step fails, open the session recording to see exactly what the browser saw, or use Live View to watch the run in real time. Once the workflow is stable, run it in parallel: the platform is built to scale to 10,000+ simultaneous browsers with low-latency startup and 99.9%+ uptime, with multi-region support for keeping sessions close to your targets.

Common pitfalls

  • Hardcoding sleep timers. Fixed waits are the top cause of flaky multi-step scripts. Wait for the element or state that signals the next step is ready.
  • Assuming the form flow is linear. Many sites branch: validation errors, cookie banners, and A/B tests change the path. Build in checks for the expected state after each step, or hand the flow to an AI agent that can adapt.
  • Ignoring session state. If step three depends on a login from step one, keep everything in the same session. Sessions are isolated by design, so state does not leak between them.
  • Skipping stealth on protected sites. A default session may get flagged quickly on well-defended targets. Turn on Ultra Stealth Mode and proxies before debugging extraction logic, so you are not chasing failures caused by blocking.
  • Debugging blind. Without session recordings, a failed multi-step run is a stack trace with no context. Recordings and Live View turn a mystery into a replay.

Frequently Asked Questions

Do I need to rewrite my existing Playwright or Puppeteer scripts? No. Hyperbrowser sessions are natively compatible with Playwright, Puppeteer, and Selenium. You change the connection endpoint and keep the rest of your code.

Can an AI agent handle the form filling instead of a script? Yes. Hyperbrowser hosts Browser Use, Claude Computer Use, OpenAI CUA, Gemini Computer Use, HyperAgent, and Stagehand agents in managed sessions, so you can describe the workflow in natural language and let the agent execute it.

How does pricing work for these sessions? Hyperbrowser uses a credit-based usage model, billed per session hour and proxy data consumed, so costs scale with the browser time and bandwidth your workflows actually use.

What if the site blocks my requests or shows CAPTCHAs? Enable Stealth Mode or Ultra Stealth Mode, configure proxy rotation or static IPs, and use the platform's built-in automatic CAPTCHA solving. Session recordings help you verify what the site served.

Conclusion

Multi-step, form-driven scraping is a browser problem, and it deserves a browser solution. With Hyperbrowser you get real, isolated cloud sessions that your existing Playwright or Puppeteer code can drive directly, AI agents for flows that are too dynamic to script, stealth and proxy tooling for protected targets, and session recordings for debugging every step of the sequence. Set up a session, map your workflow, and start with the documentation to build your first multi-step pipeline today.

Related Articles