A string can also be passed in instead of a function:
const aHandle = await page.evaluateHandle(‘document‘); // Handle for the ‘document‘
JSHandle instances can be passed as arguments to the page.evaluateHandle
:
const aHandle = await page.evaluateHandle(() => document.body);const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);console.log(await resultHandle.jsonValue());await resultHandle.dispose();
获取JSHANDLE句柄
原文地址:https://www.cnblogs.com/justart/p/9747706.html