Kreuzcrawl.PageAction (kreuzcrawl v0.3.0-rc.43)

Copy Markdown

A single page interaction action.

Actions are serialized with a type tag using camelCase naming, except ExecuteJs which is explicitly renamed to "executeJs".

Summary

Types

Click on an element matching the given CSS selector.

Execute arbitrary JavaScript in the page context.

Press a keyboard key (e.g. "Enter", "Tab", "Escape").

Scrape the current page HTML.

Take a screenshot of the current page.

Scroll the page or a specific element.

t()

A single page interaction action.

Type text into an element matching the given CSS selector.

Wait for a duration or for an element to appear.

Types

click()

@type click() :: %{type: :click, selector: String.t()}

Click on an element matching the given CSS selector.

execute_js()

@type execute_js() :: %{type: :execute_js, script: String.t()}

Execute arbitrary JavaScript in the page context.

press()

@type press() :: %{type: :press, key: String.t()}

Press a keyboard key (e.g. "Enter", "Tab", "Escape").

scrape()

@type scrape() :: :scrape

Scrape the current page HTML.

screenshot()

@type screenshot() :: %{type: :screenshot, full_page: boolean()}

Take a screenshot of the current page.

scroll()

@type scroll() :: %{
  type: :scroll,
  direction: map(),
  selector: String.t(),
  amount: integer()
}

Scroll the page or a specific element.

t()

@type t() :: term()

A single page interaction action.

type_text()

@type type_text() :: %{type: :type_text, selector: String.t(), text: String.t()}

Type text into an element matching the given CSS selector.

wait()

@type wait() :: %{type: :wait, milliseconds: integer(), selector: String.t()}

Wait for a duration or for an element to appear.