该页面https://www.bbc.co.uk/iplayer/live/bbcone
我可以在 Chrome 的 F12 控制台中查询元素“div.p_playerControls”:
document.querySelector('div.p_playerControls')
==> div class="p_playerControls" style="display: block; clip: rect(1px, 1px, 1px, 1px);"
...但不能通过远程接口:
result1 = await Runtime.evaluate({expression:"document.querySelector('div.p_playerControls')"})
result2 = await Runtime.evaluate({expression:"document.querySelector('.player__container')"})
console.log(result1.result.className)
console.log(result2.result.className)
输出:
Debugger attached.
undefined
HTMLDivElement
我做错了什么吗?.. :) 谢谢!