Javascript 如何在浏览器';谁的控制台?

Javascript 如何在浏览器';谁的控制台?,javascript,html,dom,css-selectors,virtual-dom,Javascript,Html,Dom,Css Selectors,Virtual Dom,最近,我试图在Google Chrome的控制台中遍历DOM 我不知道怎么进去。请找个人帮忙 但是我提供的链接是#selenium web驱动程序中的文档问题。我没有使用selenium web驱动程序,我只是想知道如何使用css选择器或任何其他javascript解决方案遍历#文档。这是否回答了您的问题?我了解Jquery。只知道纯javascript------>此链接建议首先通过queryselector获取iframe,即var iframe=document.queryselector

最近,我试图在Google Chrome的控制台中遍历DOM

我不知道怎么进去。请找个人帮忙


但是我提供的链接是#selenium web驱动程序中的文档问题。我没有使用selenium web驱动程序,我只是想知道如何使用css选择器或任何其他javascript解决方案遍历#文档。

这是否回答了您的问题?我了解Jquery。只知道纯javascript------>此链接建议首先通过queryselector获取iframe,即var iframe=document.queryselector('.g-recaptcha>div>div>[title]');然后使用iframe.contentDocument和iframe.contentWindow.document,如果是iframe.contentDocument,则返回null;如果是iframe.contentWindow.document,则返回错误-->未捕获的DomeException:阻止了具有原点“”的帧这个答案解释了跨源问题:它本质上只是指向wiki:但在纯javascript中没有给出任何解决方案。
var list = document.querySelectorAll('.g-recaptcha>div>div'); 
console.log(list)