Browser automation
Drive interactive pages with actions or a full CDP session.
Some data lives behind interaction — a button click, a form, a multi-step flow. The String Web Access API gives you two ways to handle it.
Lightweight: browser actions
For short, scripted sequences (and optional screenshots), pass an actions array to
/fetch. The API runs them in a managed browser and returns the final HTML
and any screenshot.
{
"url": "https://example.com",
"actions": [
{ "type": "click", "selector": "#accept-cookies" },
{ "type": "write", "text": "hello" },
{ "type": "press", "key": "Enter" },
{ "type": "screenshot" }
]
}When the data you want arrives from an API call rather than in the HTML, end the sequence with a waitForResponse
action and asResult: true. The API response comes back as data, so there is no page to parse. See
XHR capture.
When the form or widget you need is inside an iframe, give the action a frame to run it there, and add
includeIframes: true to get the iframe's content back with the page. See Iframes. When a click
sets off requests you can't name one by one, follow it with a waitForNetworkIdle action. See
Waiting for page load.
Full control: CDP browser
For open-ended automation (logins, long flows, anything dynamic), connect Puppeteer or Playwright to the CDP browser and drive the page directly.
Choosing between them
| Browser actions | CDP browser | |
|---|---|---|
| Best for | Short, known sequences | Open-ended automation |
| Interface | JSON actions array | Puppeteer / Playwright |
| Billing | Per browser session | Bandwidth + duration |
Both apply access control to every navigation.