CSS selector tester: try selectors on real HTML
Test a CSS selector against a live page or pasted HTML. See every match as you type, choose text, HTML or an attribute, and export the results.
Showing a sample page so you can try things straight away. Fetch a URL or paste HTML to use your own.
Language
Try on the sample:
0 matches
Loading…
How to use it
- 1
Load a page by URL or paste HTML. A sample document is loaded to start with.
- 2
Type a selector. Matches update on every keystroke, with a count.
- 3
Choose what to read from each match (text, inner HTML or an attribute) and export the list.
Questions
- Which selectors are supported?
- Everything your browser's querySelectorAll supports, because that is what runs: combinators, attribute selectors, :nth-child(), :not(), :is(), :where(), :has() and the rest of Selectors Level 4 in current browsers.
- Why does my selector work in DevTools but return nothing here?
- DevTools shows the page after JavaScript has changed it. This tool tests against the HTML the server returns, which is what a scraper without a browser receives. If the element is added by script, it is not in that HTML.
- Can I select by text content?
- CSS has no text selector. Switch to the XPath tester and use contains(text(), "…") or normalize-space().
Guides
Related tools
- XPath testerEvaluate XPath against real HTML, including count() and string().
- HTML parserBrowse a page as a tree and copy a selector for any element.
- Table extractorFind every table on a page and download it as CSV or Excel.
Need the same data every day, or from many pages? Build a scraper by clicking what you want, then schedule it.