browserVersion
"Chrome/138.0.0.0"
content
cookies
cookies(urls: ["https://example.com", "https://another.com"])
urls
: [String] - An optional list of URLs to retrieve cookies for.
If omitted, cookies for the current page’s URL are returned.
Example: ["https://www.example.com", "https://sub.example.com"]
pdf
pdf(options: { format: A4, landscape: true, printBackground: true })
options
: PDFOptions - Options to customize the PDF output, such as paper size, orientation, margins, and more.
See PDFOptions
for details.response
page(content: "...")
).
status
storageState
title
<title>
HTML tag.
url
userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
viewport
performance
element
element(selector: ".my-class", text: "Submit")
selector
: String - The CSS selector for the element. Example: "#username"
for <input id="username" />
.text
: String - Finds an element by its text content. Example: "Login"
for <button>Login</button>
.role
: ARIARole - Finds an element by its ARIA role. Example: "button"
for <div role="button">Submit</div>
.label
: String - Finds an element by its ARIA label. Example: "Search button"
for <button aria-label="Search button"><svg/></button>
.placeholder
: String - Finds an element by its placeholder text. Example: "Enter your email"
for <input placeholder="Enter your email" />
.altText
: String - Finds an element by its image alt text. Example: "Company logo"
for <img alt="Company logo" src="..." />
.title
: String - Finds an element by its title attribute. Example: "Close dialog"
for <span title="Close dialog">X</span>
.testId
: String - Finds an element by its data-testid attribute. Example: "submit-button"
for <button data-testid="submit-button">Go</button>
.filter
: ElementFilterOptions - Advanced filtering options for the element.elements
elements(selector: "div.product-item")
selector
: String - The CSS selector for the element. Example: "#username"
for <input id="username" />
.text
: String - Finds an element by its text content. Example: "Login"
for <button>Login</button>
.role
: ARIARole - Finds an element by its ARIA role. Example: "button"
for <div role="button">Submit</div>
.label
: String - Finds an element by its ARIA label. Example: "Search button"
for <button aria-label="Search button"><svg/></button>
.placeholder
: String - Finds an element by its placeholder text. Example: "Enter your email"
for <input placeholder="Enter your email" />
.altText
: String - Finds an element by its image alt text. Example: "Company logo"
for <img alt="Company logo" src="..." />
.title
: String - Finds an element by its title attribute. Example: "Close dialog"
for <span title="Close dialog">X</span>
.testId
: String - Finds an element by its data-testid attribute. Example: "submit-button"
for <button data-testid="submit-button">Go</button>
.filter
: ElementFilterOptions - Advanced filtering options for the element.ariaSnapshot
attribute
attribute(name: "href")
on an <a>
tag, or attribute(name: "data-custom")
on any element.
name
: String! - The name of the attribute to retrieve. Example: "class"
, "id"
, "value"
, "src"
.attributes
{ "id": "myElement", "class": "active important", "data-value": "123" }
boundingBox
innerHTML
<p>Hello <b>world</b></p>
, innerHTML would be "Hello <b>world</b>"
.
innerText
<p>Hello <b>world</b></p>
, innerText might be "Hello world"
.
markdown
screenshot
screenshot(options: { type: PNG, omitBackground: true })
options
: ScreenshotOptions - Options to configure the screenshot, such as image type, quality, or clipping. See ScreenshotOptions
.textContent
<script>
and <style>
tags.
Example: For <p>Hello <b>world</b></p>
, textContent would be "Hello world"
.