Searching for HTML elements in Chrome DevTools

天大地大妈咪最大 提交于 2020-07-31 06:42:47

问题


On this website, there's a div with the attribute class="item". When I clicked F12 to bring up the Developer Tools. I pressed Ctrl + F and typed in class="item" and no results came back. I also tried Ctrl + Shift + F but nothing returned. Here is a screenshot:

enter image description here

Even if I search for class=, only text within HTML comments are found. Thanks in advance for any help you are able to provide.


回答1:


I searched for the XPath of the element instead and it worked:

//*[@class="item"]




回答2:


Late answer but pretty sure .item would've worked.




回答3:


This seems like it might be a bug. You can report it on http://crbug.com.

If you were to search for 'item' you should be able to find the elements that have the class item on them.




回答4:


Dayuloli's fix is a good one, you can also just search for "item" although that won't work if there are multiple classes on that element.



来源:https://stackoverflow.com/questions/22498176/searching-for-html-elements-in-chrome-devtools

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