Skip to content

PuppeteerHandleExtensions

Namespace: PuppeteerSharp

public static class PuppeteerHandleExtensions

IJSHandle and IElementHandle Extensions.

Inheritance: object

View source

EvaluateFunctionAsync(Task<IElementHandle>, string, params object[])

Section titled “EvaluateFunctionAsync(Task<IElementHandle>, string, params object[])”
public static Task EvaluateFunctionAsync(this Task<IElementHandle> elementHandleTask, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome of <code class=“paramref”>elementHandleTask</code> as the first argument.

Parameters

Name Type Description
elementHandleTask Task<IElementHandle> A task that returns an IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task — Task.

Exceptions

Type Condition
SelectorException If <code class=“paramref”>elementHandleTask</code> resolves to null.

View source

EvaluateFunctionAsync(Task<IJSHandle>, string, params object[])

Section titled “EvaluateFunctionAsync(Task<IJSHandle>, string, params object[])”
public static Task EvaluateFunctionAsync(this Task<IJSHandle> arrayHandleTask, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome of <code class=“paramref”>arrayHandleTask</code> as the first argument. Use only after QuerySelectorAllHandleAsync(string).

Parameters

Name Type Description
arrayHandleTask Task<IJSHandle> A task that returns an IJSHandle that represents an array of IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task — Task.

View source

EvaluateFunctionAsync<T>(IElementHandle, string, params object[])

Section titled “EvaluateFunctionAsync<T>(IElementHandle, string, params object[])”
public static Task<T> EvaluateFunctionAsync<T>(this IElementHandle elementHandle, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome the <code class=“paramref”>elementHandle</code> as the first argument.

Type parameters

Name Description
T The type of the response.

Parameters

Name Type Description
elementHandle IElementHandle An IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task<T> — Task which resolves to the return value of pageFunction.

Exceptions

Type Condition
SelectorException If <code class=“paramref”>elementHandle</code> is null.

View source

EvaluateFunctionAsync<T>(IJSHandle, string, params object[])

Section titled “EvaluateFunctionAsync<T>(IJSHandle, string, params object[])”
public static Task<T> EvaluateFunctionAsync<T>(this IJSHandle arrayHandle, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome of <code class=“paramref”>arrayHandle</code> as the first argument. Use only after QuerySelectorAllHandleAsync(string).

Type parameters

Name Description
T The type to deserialize the result to.

Parameters

Name Type Description
arrayHandle IJSHandle An IJSHandle that represents an array of IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task<T> — Task which resolves to the return value of pageFunction.

View source

EvaluateFunctionAsync<T>(Task<IElementHandle>, string, params object[])

Section titled “EvaluateFunctionAsync<T>(Task<IElementHandle>, string, params object[])”
public static Task<T> EvaluateFunctionAsync<T>(this Task<IElementHandle> elementHandleTask, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome of <code class=“paramref”>elementHandleTask</code> as the first argument.

Type parameters

Name Description
T The type of the response.

Parameters

Name Type Description
elementHandleTask Task<IElementHandle> A task that returns an IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task<T> — Task which resolves to the return value of pageFunction.

Exceptions

Type Condition
SelectorException If <code class=“paramref”>elementHandleTask</code> resolves to null.

View source

EvaluateFunctionAsync<T>(Task<IJSHandle>, string, params object[])

Section titled “EvaluateFunctionAsync<T>(Task<IJSHandle>, string, params object[])”
public static Task<T> EvaluateFunctionAsync<T>(this Task<IJSHandle> arrayHandleTask, string pageFunction, params object[] args)

Runs <code class=“paramref”>pageFunction</code> within the frame and passes it the outcome of <code class=“paramref”>arrayHandleTask</code> as the first argument. Use only after QuerySelectorAllHandleAsync(string).

Type parameters

Name Description
T The type to deserialize the result to.

Parameters

Name Type Description
arrayHandleTask Task<IJSHandle> A task that returns an IJSHandle that represents an array of IElementHandle that will be used as the first argument in <code class=“paramref”>pageFunction</code>.
pageFunction string Function to be evaluated in browser context.
args object[] Arguments to pass to pageFunction.

Returns: Task<T> — Task which resolves to the return value of pageFunction.

View source

Made with love by Dario Kondratiuk