Table of Contents

Class CdpElementHandle

Namespace
PuppeteerSharp.Cdp
Assembly
PuppeteerSharp.dll

Inherits from IJSHandle. It represents an in-page DOM element. ElementHandles can be created by QuerySelectorAsync(string) or QuerySelectorAllAsync(string).

public class CdpElementHandle : ElementHandle, IElementHandle, IJSHandle, IAsyncDisposable
Inheritance
CdpElementHandle
Implements
Extension Methods

Properties

Page

Element's page.

protected override Page Page { get; }

Property Value

Page

Methods

ContentFrameAsync()

Resolves the frame associated with the element..

public override Task<IFrame> ContentFrameAsync()

Returns

Task<IFrame>

Task which resolves to the frame associated with the element.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public override ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

ScrollIntoViewAsync()

Scrolls the element into view using either the automation protocol client or by calling element.scrollIntoView.

public override Task ScrollIntoViewAsync()

Returns

Task

A Task that resolves when the message was confirmed by the browser.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UploadFileAsync(bool, params string[])

Uploads files.

public override Task UploadFileAsync(bool resolveFilePaths, params string[] filePaths)

Parameters

resolveFilePaths bool

Set to true to resolve paths using GetFullPath(string).

filePaths string[]

Sets the value of the file input to these paths. Paths are resolved using GetFullPath(string).

Returns

Task

Task.

Remarks

This method expects elementHandle to point to an input elementhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input.