Class PuppeteerHandleExtensions
- Namespace
- PuppeteerSharp
- Assembly
- PuppeteerSharp.dll
IJSHandle and IElementHandle Extensions.
public static class PuppeteerHandleExtensions
- Inheritance
-
PuppeteerHandleExtensions
Methods
EvaluateFunctionAsync(Task<IElementHandle>, string, params object[])
Runs pageFunction within the frame and passes it the outcome of elementHandleTask as the first argument.
public static Task EvaluateFunctionAsync(this Task<IElementHandle> elementHandleTask, string pageFunction, params object[] args)
Parameters
elementHandleTaskTask<IElementHandle>A task that returns an IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task
Task.
Exceptions
- SelectorException
If
elementHandleTaskresolves tonull.
EvaluateFunctionAsync(Task<IJSHandle>, string, params object[])
Runs pageFunction within the frame and passes it the outcome of arrayHandleTask as the first argument. Use only after QuerySelectorAllHandleAsync(string).
public static Task EvaluateFunctionAsync(this Task<IJSHandle> arrayHandleTask, string pageFunction, params object[] args)
Parameters
arrayHandleTaskTask<IJSHandle>A task that returns an IJSHandle that represents an array of IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task
Task.
EvaluateFunctionAsync<T>(IElementHandle, string, params object[])
Runs pageFunction within the frame and passes it the outcome the elementHandle as the first argument.
public static Task<T> EvaluateFunctionAsync<T>(this IElementHandle elementHandle, string pageFunction, params object[] args)
Parameters
elementHandleIElementHandleAn IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task<T>
Task which resolves to the return value of
pageFunction.
Type Parameters
TThe type of the response.
Exceptions
- SelectorException
If
elementHandleisnull.
EvaluateFunctionAsync<T>(IJSHandle, string, params object[])
Runs pageFunction within the frame and passes it the outcome of arrayHandle as the first argument. Use only after QuerySelectorAllHandleAsync(string).
public static Task<T> EvaluateFunctionAsync<T>(this IJSHandle arrayHandle, string pageFunction, params object[] args)
Parameters
arrayHandleIJSHandleAn IJSHandle that represents an array of IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task<T>
Task which resolves to the return value of
pageFunction.
Type Parameters
TThe type to deserialize the result to.
EvaluateFunctionAsync<T>(Task<IElementHandle>, string, params object[])
Runs pageFunction within the frame and passes it the outcome of elementHandleTask as the first argument.
public static Task<T> EvaluateFunctionAsync<T>(this Task<IElementHandle> elementHandleTask, string pageFunction, params object[] args)
Parameters
elementHandleTaskTask<IElementHandle>A task that returns an IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task<T>
Task which resolves to the return value of
pageFunction.
Type Parameters
TThe type of the response.
Exceptions
- SelectorException
If
elementHandleTaskresolves tonull.
EvaluateFunctionAsync<T>(Task<IJSHandle>, string, params object[])
Runs pageFunction within the frame and passes it the outcome of arrayHandleTask as the first argument. Use only after QuerySelectorAllHandleAsync(string).
public static Task<T> EvaluateFunctionAsync<T>(this Task<IJSHandle> arrayHandleTask, string pageFunction, params object[] args)
Parameters
arrayHandleTaskTask<IJSHandle>A task that returns an IJSHandle that represents an array of IElementHandle that will be used as the first argument in
pageFunction.pageFunctionstringFunction to be evaluated in browser context.
argsobject[]Arguments to pass to
pageFunction.
Returns
- Task<T>
Task which resolves to the return value of
pageFunction.
Type Parameters
TThe type to deserialize the result to.