Skip to main content
Version: 24.38.0

JSHandle.evaluateHandle() 方法

🌐 JSHandle.evaluateHandle() method

使用当前句柄作为第一个参数来计算给定函数。

🌐 Evaluates the given function with the current handle as its first argument.

语法

🌐 Signature

class JSHandle {
evaluateHandle<
Params extends unknown[],
Func extends EvaluateFuncWith<T, Params> = EvaluateFuncWith<T, Params>,
>(
pageFunction: Func | string,
...args: Params
): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
}

参数

🌐 Parameters

范围

🌐 Parameter

类型

🌐 Type

描述

🌐 Description

pageFunction

函数 | 字符串

🌐 Func | string

args

参数

🌐 Params

返回:

Promise<HandleFor<Awaited<ReturnType<Func>>>>