How to search DOM elements using XPath or CSS selectors in Chrome Developer Tools?

﹥>﹥吖頭↗ 提交于 2019-12-02 13:58:20

You can use $x in the Chrome javascript console. No extensions needed.

ex: $x("//img")

Yury Semikhatsky

Just typing xpath expression in the search box should work. It works for me in tip-of-tree build.

The feature seems to be broken in Chrome 11 though, I've filed a bug on this: http://crbug.com/79716

For xpath searches use $x('xpathSelector'). For a css selector use $('cssSelector').

However, this last selector returns only the first matching element. If you want to see all matching elements go for $$('cssSelector')

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!