我可以使用剧作家/木偶师来获取单元格。我想分别捕获以下两个值 - 日期和状态。
我有以下代码:
let allCells = await allRows[0].$$('[role="cell"]');
let ele = await allCells[0].$('.description');
let status = await (await ele.getProperty("innerText")).jsonValue();
// I can get the status as 'uploaded' just fine using this
allCells[0].removeChild(ele); // this throws an error
let uploadDate = await (await allCells[0]("innerText")).jsonValue();
它抛出的错误是: TypeError: allCells[0].removeChild is not a function
console.log( allCells[0] ) 返回:JSHandle@…。
这是 HTML 的相关部分:
<html>
<body>
<div role="cell" class="cell-body">
<!---->Jul 11, 2021
<div class="description">
uploaded
</div>
</div>
</body>
</html>