ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Different results in F12 and CDP #213

Closed MilnerAlex closed 4 years ago

MilnerAlex commented 4 years ago

The page https://www.bbc.co.uk/iplayer/live/bbcone I can query element “div.p_playerControls” in Chrome's F12 console:

document.querySelector('div.p_playerControls') div class=​"p_playerControls" style=​"display:​ block;​ clip:​ rect(1px, 1px, 1px, 1px)​;​"

...but cannot via remote interface:

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)

Output: Debugger attached. undefined HTMLDivElement

Am I do something wrong?.. :) Thanks! player2

MilnerAlex commented 4 years ago

Problem is solved now (just different frames).