页面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
我做错了吗?.. :)谢谢!
答案 0 :(得分:0)
问题已解决(来自不同框架的元素)。这里的详细信息https://github.com/hardkoded/puppeteer-sharp/issues/1465