【发布时间】:2022-02-02 01:12:09
【问题描述】:
我有这个代码sn-p:
const historicalDataTable = await findElementByClass(
"table",
elementClass,
page
); // This is a custom function I wrote. Works as expected.
const tableBody = await historicalDataTable.$eval(
"tbody",
(el) => el.children.length
);
console.log(tableBody);
这按预期工作并返回正确数量的子项。但是当我这样做时
const tableBody = await historicalDataTable.$eval(
"tbody",
(el) => el.children
);
并删除长度,它返回未定义。这是怎么回事?
【问题讨论】: