Switch to Iframe Action API Reference ๐ผ๏ธ
Note: This is an early version (v0.1) of Go-Ski and is subject to change. Iframe switching is currently in very early stage beta. Still figuring ou the best way to handle traversing iframes (especially nested frames). Open to thoughts or suggestions!
Introduction ๐
The SwitchToIframe
action allows you to switch the context to an iframe on the web page. This is part of the core
package in Go-Ski.
Syntax ๐
Here's how you define a SwitchToIframe
action:
Action{
Type: core.SwitchToIframe,
IframeXPath: "/html/body/iframe",
}
Parameters ๐ ๏ธ
Type
: Should be set tocore.SwitchToIframe
.IframeXPath
: The XPath of the iframe you want to switch to.
Example ๐
Here's a simple example that switches to an iframe:
Action{
Type: core.SwitchToIframe,
IframeXPath: "/html/body/iframe",
}
Conclusion ๐
The SwitchToIframe
action is crucial for interacting with web pages that use iframes. It allows you to switch context and perform actions within the iframe.
For the complete example, you can check out the Go-Ski GitHub Repository (opens in a new tab).