Browser Automation
Shape the page first. Set the device, wait for the right state, click, and run scripts — declarative options on the same request, applied before capture.
Overview
Declarative steps, then the capture.
Pass automation options on any product call — device, waitUntil, waitForSelector, click, scripts. The page is shaped into the right state before the screenshot, PDF, or data is taken.
- One product call — the page is prepared, then captured
- device emulates viewport, DPR and user-agent presets
- waitUntil / waitForSelector settle dynamic, client-rendered pages
- click, scroll and scripts drive the UI before extraction
- Escalate to a function only when the flow is truly custom
Parameters
Options that shape the page.
devicestringEmulate a viewport, DPR and user-agent preset before load.waitUntilstringNavigation settle event — 'networkidle0', 'load', ….waitForSelectorstringBlock until a selector is present before capturing.click / scrollstringInteract with the page — target elements by selector.scriptsstring | string[]Inject and run JavaScript in the page context before read.
Examples
Shape the page, then capture.
device presets the viewport before the screenshot is taken.
Emulate a phone
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const { url } = await microlink.screenshot(
'https://example.com',
{ device: 'iPhone 11', fullPage: true }
)