CSS Selector Tester
Test CSS selectors against HTML snippets
Paste your HTML, write a CSS selector, and immediately see what it matches. No browser console, no live page needed — just the markup you're working with. Useful when you're writing a scraper and want to confirm that .product-title > a actually grabs what you think it does, before running it against a thousand pages.
No input provided
How to use
- 1Paste HTML — Copy the HTML fragment from DevTools (Inspect → Copy outerHTML) or the page source.
- 2Write a selector — Enter a CSS selector in the Selector field. For example: .product-card h2 a or div[data-id].
- 3Get results — In auto mode, matches are highlighted as you type. Disable auto mode to run manually with Run.
- 4Refine your selector — Too many or too few matches? Adjust the selector and re-run. Changes apply instantly.
Examples
.product-card .title anav.pagination a[href]ul.results li:nth-child(3)div[data-product-id].item:not(.disabled)When to use for web scraping
CSS selectors are the foundation of most Python and Node.js scrapers: BeautifulSoup, Cheerio, Scrapy, and Playwright use them natively. The problem is that selectors that look correct in DevTools often break on real HTML — because DevTools shows the live DOM after JavaScript execution, not the raw source. This tool works directly with an HTML string — exactly the way your parser will. Test your selector against the raw HTML before running a crawler on thousands of pages and discovering the class name differed by one character. Especially useful: paste HTML from Request Tester to get the raw page response, write and test your selector here, then copy to your code.