What is an iframe?
Iframes embed other pages within your current page. Sites use them for consent banners, payment widgets, chat bubbles, and third-party content. Elements inside iframes exist in a separate context than the main page.Enable iframe support
Setiframes: true
in your act()
, observe()
, and extract()
commands.
Tips
- Iframes can increase processing time. For best performance, use the iframe option only when necessary.
- When you are unsure whether an element will be in an iframe, you can verify the presence of iframes in Stagehand logs.
- If an element intermittently fails to be found, it may be inside a lazy‑loaded iframe. Add small waits between steps or re‑run your action.
You can enable experimental features (like Shadow DOM support) via your Stagehand configuration. See the configuration guide.
Next steps
Analyze pages with observe()
Use
observe()
to plan precise, single-step actions before executing them.Extract data with extract()
Use
extract()
with a data schema to pull clean, typed data from any page.Caching actions
Speed up repeated automations by caching actions.
Act fundamentals
Learn how to perform single-step actions reliably with
act()
.