Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching for HTML elements in Chrome DevTools

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.

like image 542
dayuloli Avatar asked Mar 19 '14 06:03

dayuloli


People also ask

How do I search HTML elements in Chrome?

Searching the current HTML You want to perform a text string search on the current HTML page. Routine: From the elements panel, use a keyboard shortcut (win: Ctrl+f, mac: Cmd+f) to open up the search input UI. Enter any text you'd like to be found on the current HTML page.

How do I search inspect element in HTML?

Just right-click and click Inspect Inspect Element, or press Command+Option+i on your Mac or F12 on your PC. In the search field, you can type anything—ANYTHING—that you want to find on this web page, and it will appear in this pane.

How do you find the inspect element?

Right-click any part of the page and choose Inspect Element. Right-clicking a specific page element will open that element in the inspector view. Select Tools > Web Developer > Inspector from the top menu bar. Use the shortcut control-shift-C in Windows or command-option-C in macOS.

How do I search my browser element?

Another way to locate the web element is to click on the “Find” button present in the top menu and by clicking on the desired web element within the web page.

How do I perform a search-find-edit using Chrome DevTools?

Below, you will find 16 short videos detailing solutions to the most common search-find-edit routines using Chrome DevTools. 1. Searching the current HTML You want to perform a text string search on the current HTML page. Routine: From the elements panel, use a keyboard shortcut (win: Ctrl+f, mac: Cmd+f) to open up the search input UI.

What is the element tool in Chrome Developer Tools?

The I nspect Element tool is a simple yet powerful built-in feature that comes with Chrome Developer Tools. It’s handy because we can modify a web page’s look or do CSS editing live on the browser.

How do I search for a specific element in HTML?

Search for an element Before you start searching, make sure to keep the focus on the element tab. Then simply doing a Ctrl+F, a search bar would appear at the bottom of the DOM Tree. (The search bar supports CSS and XPath selectors also.)

How to debug CSS with Chrome DevTools?

Luckily, Chrome also provides some great tools for quickly prototyping CSS changes using DevTools. To the right of the HTML view in the “Elements” tab, there is a view showing a breakdown of what CSS rules apply to the selected element. This view can be extremely helpful for debugging a plethora of CSS bugs.


2 Answers

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

//*[@class="item"]

like image 132
dayuloli Avatar answered Sep 21 '22 05:09

dayuloli


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

like image 33
Amauri Avatar answered Sep 20 '22 05:09

Amauri