Searching for HTML elements in Chrome DevTools

73,988

Solution 1

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

//*[@class="item"]

Solution 2

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

Solution 3

Search bar only supports string, CSS selectors or XPath selectors.

I recommend you use CSS selectors: [class="item"]

Share:
73,988
dayuloli
Author by

dayuloli

Updated on July 13, 2022

Comments

  • dayuloli
    dayuloli almost 2 years

    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.

  • Szczepan Hołyszewski
    Szczepan Hołyszewski almost 2 years
    XPath is hard. It is essentially a programming language. It is not suitable for routine needs like "this particular image fails to lazyload, I must find it by a string present in one of its attributes, but I don't know which one exactly because this is what I am yet to debug".