Skip to main content

html

Returns the HTML content of the page or selector when specified

Example:

mutation GetHTML {
goto(url: "https://example.com") {
status
}
html(selector: "h1") {
html
}
}
html(
selector: String
timeout: Float
visible: Boolean = false
): HTMLResponse

Arguments

html.selector ● String scalar

The DOM selector of the given element you want to return the HTML of

html.timeout ● Float scalar

The maximum amount of time, in milliseconds, to wait for the selector to appear, overriding any defaults. Default timeout is 30 seconds, or 30000.

html.visible ● Boolean scalar

Whether or not to return the HTMLπ content of the element only if it's visible

Type

HTMLResponse object

HTML content of a page