How to use chrome dev tools to find elements based on css class or id?

17,876

The find() method refers to window.find(), a non-standard API for the browser's built-in Find function. It does not find web elements the same way Selenium or Capybara do, and so it does not parse the input as a selector.

You find elements with selectors in Chrome DevTools using document.querySelector() or document.querySelectorAll(). There are no special methods in Chrome DevTools for this, however it does provide the $() and $$() aliases (respectively) to save you time and keystrokes.

Share:
17,876
Michael Durrant
Author by

Michael Durrant

rails ruby rspec rock

Updated on June 16, 2022

Comments