Sessions
- create_session
- Isolated context. Returns a lease, once.
- list_sessions
- Yours unless you ask for all. Never a lease.
- session_info
- Owner and page ids.
- reattach
- Recover sessions and leases after a restart.
- close_session
- Close it, free the slot.
- status
- Live sessions, quota, browser.
Pages
- new_page
- Open and wait.
- navigate
- Go somewhere, wait.
- list_pages
- Ids, URLs, titles.
- get_page_state
- URL, title, real HTTP status, viewport. Cheap.
- wait_for
- Until text appears, goes, or a predicate holds.
- close_page
- Close it, free the slot.
Acting on a page
- snapshot
- Accessibility tree. The only source of things you can click.
- click · hover
- Refused, with a reason, if covered or disabled.
- fill · type_text
- Replace a value, or type it key by key.
- select_option
- By value, label or text.
- press_key
- No element involved.
- drag
- One element onto another.
- upload_file
- Onto a file input.
- handle_dialog
- Alert, confirm, prompt, beforeunload.
- evaluate
- JavaScript in the page, value back.
What happened
- get_events
- Browser events and the agent's own calls, one timeline.
- get_errors
- Exceptions, failed requests, Chrome's audit issues.
- get_console_logs
- Filterable by level.
- list_network_requests
- By status class, type or URL.
- get_network_request
- In full, body included.
- get_html · screenshot
- Markup, or a picture by reference.
Conditions and performance
- emulate · resize
- Device, viewport, UA, scheme, touch.
- set_network_conditions
- Throttle, add latency, go offline.
- get_storage_state
- Cookies and storage.
- set_storage_state
- Put them back. Logins are reusable.
- get_performance_metrics
- Timings and Web Vitals. No queue.
- run_audit · get_audit
- Real Lighthouse, own browser, one slot. Returns a ticket.