Documentation ¶
Index ¶
- func Children(frame *cdp.Frame, nodeID dom.NodeID, timeout time.Duration) error
- func Clear(frame *cdp.Frame, find string, timeout time.Duration) error
- func Click(frame *cdp.Frame, find string, events []cdp.Event, timeout time.Duration) ([]cdp.Event, error)
- func ClickNodeID(frame *cdp.Frame, nodeID dom.NodeID, modifiers int, events []cdp.Event, ...) ([]cdp.Event, error)
- func ClickWithModifiers(frame *cdp.Frame, find string, modifiers int, events []cdp.Event, ...) ([]cdp.Event, error)
- func Cookies(frame *cdp.Frame, timeout time.Duration) ([]network.Cookie, error)
- func EnableAll(frame *cdp.Frame, timeout time.Duration) error
- func EnableCSS(frame *cdp.Frame, timeout time.Duration) error
- func EnableDom(frame *cdp.Frame, timeout time.Duration) error
- func EnableIndexedDB(frame *cdp.Frame, timeout time.Duration) error
- func EnableLog(frame *cdp.Frame, timeout time.Duration) error
- func EnableNetwork(frame *cdp.Frame, timeout time.Duration) error
- func EnablePage(frame *cdp.Frame, timeout time.Duration) error
- func EnableRuntime(frame *cdp.Frame, timeout time.Duration) error
- func Evaluate(frame *cdp.Frame, expression string, timeout time.Duration) (*runtime.EvaluateReply, error)
- func Fill(frame *cdp.Frame, find, fill string, timeout time.Duration) error
- func FindAll(frame *cdp.Frame, find string, timeout time.Duration) ([]dom.Node, error)
- func FindFirstElementNodeID(frame *cdp.Frame, find string, timeout time.Duration) (dom.NodeID, error)
- func Focus(frame *cdp.Frame, find string, timeout time.Duration) error
- func GetComputedStyleForNode(frame *cdp.Frame, nodeID dom.NodeID, timeout time.Duration) (*css.GetComputedStyleForNodeReply, error)
- func GetEntireDocument(frame *cdp.Frame, timeout time.Duration) (*dom.GetFlattenedDocumentReply, error)
- func GetFrameNavigatedURL(events []cdp.Event) string
- func GetNavigationEvents() []cdp.Event
- func GetProperties(frame *cdp.Frame, objectID shared.RemoteObjectID, ...) (*runtime.GetPropertiesReply, error)
- func GetWindowsVirtualKeyCode(modifiers int) int
- func KeyDown(frame *cdp.Frame, modifiers int, timeout time.Duration) error
- func MouseScroll(frame *cdp.Frame, deltaX, deltaY float64, timeout time.Duration) error
- func Navigate(frame *cdp.Frame, url string, timeout time.Duration) ([]cdp.Event, error)
- func RequestData(frame *cdp.Frame, ...) (*indexeddb.RequestDataReply, error)
- func RequestDatabase(frame *cdp.Frame, securityOrigin, databaseName string, timeout time.Duration) (*indexeddb.RequestDatabaseReply, error)
- func RequestDatabaseNames(frame *cdp.Frame, securityOrigin string, timeout time.Duration) (*indexeddb.RequestDatabaseNamesReply, error)
- func Screenshot(frame *cdp.Frame, destination, format string, quality int, clip *page.Viewport, ...) (err error)
- func SetAttributeValue(frame *cdp.Frame, nodeID dom.NodeID, name, value string, timeout time.Duration) error
- func SetCookie(frame *cdp.Frame, url string, cookie *http.Cookie, timeout time.Duration) (bool, error)
- func SetDeviceMetricsOverride(frame *cdp.Frame, width, height int, mobile bool, timeout time.Duration) error
- func WaitForComputedStyle(frame *cdp.Frame, find, cssPropery, cssValue string, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Children ¶
Children of the first element node that matches the find parameter. If the frame.DOM object already has the data, this call will do nothing. Otherwise, it should trigger DOM.setChildNodes events. NOTE: It appears that before this action will be completed (before the reply is received), if the server has not yet sent any/some of the child nodes of the given nodeID, then it will send those to the client
as DOM.setChildNodes events. We do not need to pick those up here since there is a method in the websocket loop of github.com/4ydx/chrome-protocol that watches for such events and updates the DOM object. In fact, I don't know how many of those events might be fired and an action's event slice isn't designed to handle multiples of the same event type.
func Click ¶
func Click(frame *cdp.Frame, find string, events []cdp.Event, timeout time.Duration) ([]cdp.Event, error)
Click on the first element matching the find parameter. Any events that need to be tracked as a result of the click must be included. This will insure that the click action waits until required events are fired.
func ClickNodeID ¶
func ClickNodeID(frame *cdp.Frame, nodeID dom.NodeID, modifiers int, events []cdp.Event, timeout time.Duration) ([]cdp.Event, error)
ClickNodeID clicks on the element identified by the given dom.NodeID value.
func ClickWithModifiers ¶
func ClickWithModifiers(frame *cdp.Frame, find string, modifiers int, events []cdp.Event, timeout time.Duration) ([]cdp.Event, error)
ClickWithModifiers clicks on a found element using the specified key modifier values.
func EnableIndexedDB ¶
EnableIndexedDB tells the server to send the indexeddb event values across the websocket.
func EnableLog ¶ added in v1.0.3
EnableLog tells the server to send the log event values across the websocket.
func EnableNetwork ¶
EnableNetwork tells the server to send the network event values across the websocket.
func EnablePage ¶
EnablePage tells the server to send the page event values across the websocket.
func EnableRuntime ¶
EnableRuntime tells the server to send the runtime event values across the websocket.
func Evaluate ¶
func Evaluate(frame *cdp.Frame, expression string, timeout time.Duration) (*runtime.EvaluateReply, error)
Evaluate runs the javascript expression in the current frame's context.
func Fill ¶
Fill on the first element node that matches the find parameter. dom.Focus can be called in order to focus an element in order to fill it.
func FindFirstElementNodeID ¶
func FindFirstElementNodeID(frame *cdp.Frame, find string, timeout time.Duration) (dom.NodeID, error)
FindFirstElementNodeID gets the first element's nodeId using XPath, Css selector, or text matches with the find parameter.
func GetComputedStyleForNode ¶
func GetComputedStyleForNode(frame *cdp.Frame, nodeID dom.NodeID, timeout time.Duration) (*css.GetComputedStyleForNodeReply, error)
GetComputedStyleForNode get the computed style for a node.
func GetEntireDocument ¶
func GetEntireDocument(frame *cdp.Frame, timeout time.Duration) (*dom.GetFlattenedDocumentReply, error)
GetEntireDocument retrieves the root document and all children for the entire page.
func GetFrameNavigatedURL ¶
func GetFrameNavigatedURL(events []cdp.Event) string
GetFrameNavigatedURL returns the url of the FrameNavigatedReply object in the array of events. When using GetNavigationEvents in conjunction with the Click action, the resulting events will have one FrameNavigatedReply. Using this method allows quick access of the FrameNavigatedReply URL, which is usually the navigated to URL for simple webpages.
func GetNavigationEvents ¶
func GetNavigationEvents() []cdp.Event
GetNavigationEvents returns all events that are expected to occur after a page navigation api request is made.
func GetProperties ¶
func GetProperties(frame *cdp.Frame, objectID shared.RemoteObjectID, ownProperties, accessorPropertiesOnly bool, timeout time.Duration) (*runtime.GetPropertiesReply, error)
GetProperties runs the properties of a given object.
func GetWindowsVirtualKeyCode ¶
GetWindowsVirtualKeyCode returns the known javascript value for a given modifier key. The meta/command modifier is not currently supported as it appear to vary across implementations.
func MouseScroll ¶
MouseScroll scrolls the mouse the given amount.
func RequestData ¶
func RequestData(frame *cdp.Frame, securityOrigin, databaseName, objectStoreName, indexName string, skipCount, pageSize int, keyRange *indexeddb.KeyRange, timeout time.Duration) (*indexeddb.RequestDataReply, error)
RequestData returns the requested data.
func RequestDatabase ¶
func RequestDatabase(frame *cdp.Frame, securityOrigin, databaseName string, timeout time.Duration) (*indexeddb.RequestDatabaseReply, error)
RequestDatabase returns the database with object stores.
func RequestDatabaseNames ¶
func RequestDatabaseNames(frame *cdp.Frame, securityOrigin string, timeout time.Duration) (*indexeddb.RequestDatabaseNamesReply, error)
RequestDatabaseNames returns a list of the databases controlled by the given security origin.
func Screenshot ¶
func Screenshot(frame *cdp.Frame, destination, format string, quality int, clip *page.Viewport, timeout time.Duration) (err error)
Screenshot captures a screenshot and saves it to the given destination.
func SetAttributeValue ¶
func SetAttributeValue(frame *cdp.Frame, nodeID dom.NodeID, name, value string, timeout time.Duration) error
SetAttributeValue sets the value of the given attribute of the given nodeID to the given value.
func SetCookie ¶
func SetCookie(frame *cdp.Frame, url string, cookie *http.Cookie, timeout time.Duration) (bool, error)
SetCookie sets one cookie in the browser.
func WaitForComputedStyle ¶
func WaitForComputedStyle(frame *cdp.Frame, find, cssPropery, cssValue string, timeout time.Duration) error
WaitForComputedStyle finds the first element on a page by id, css, or xpath and waits until the given css propery is set to the given css value. For instance, wait until the cssPropery "display" is set to cssValue "none". That is, until the found html element disappears from view.
Types ¶
This section is empty.