A page (tab) handle and the operations you run against it.
A CDPEx.Page is a lightweight struct — not a process — holding the page's
CDPEx.Connection pid and target id. Operations are functions over that
connection, so the OTP properties (supervision, crash isolation) live in the
connection/browser layer while page calls stay ergonomic.
Obtain one with CDPEx.new_page/2. If the underlying page dies (navigation to
a new target, a crash), operations return {:error, :noproc} and you should
open a fresh page.
Summary
Functions
Clicks the first element matching css (a synthetic JS .click()).
Evaluates a JavaScript expression and returns its value (returnByValue).
Returns the page's full serialized HTML (document.documentElement.outerHTML).
Navigates to url and (by default) waits until the network is almost idle.
Captures a PNG screenshot.
Polls until css matches an element, or timeout elapses.
Types
Functions
Clicks the first element matching css (a synthetic JS .click()).
Returns :ok, or {:error, {:selector_not_found, css}} when nothing matches.
Evaluates a JavaScript expression and returns its value (returnByValue).
A thrown JS exception is {:error, {:evaluate_exception, details}}.
Options: :timeout (default 15_000), :await_promise (default false).
Returns the page's full serialized HTML (document.documentElement.outerHTML).
Captures a PNG screenshot.
Returns {:ok, png_binary}, or {:ok, path} when :path is given (the file
is written and the path returned).
Options: :path (write to file), :full_page (capture beyond the viewport,
default false), :timeout (default 30_000).
Polls until css matches an element, or timeout elapses.
Returns :ok or {:error, :timeout}. Options: :timeout (default 5_000),
:interval (poll interval ms, default 100).