Geekflare

Free CSS Selector Tester

Test CSS selectors against a live page and generate extraction code.

Powered by Geekflare Web Scraping API

What Is a CSS Selector Tester?

Before writing a scraper, it's worth confirming your CSS selectors actually match what you expect on the live page. This tool loads any URL and lets you test selectors against it without reloading the page for every attempt.

How to Use It

  1. Enter a URL and click Load Page. The page is fetched once via the Geekflare Web Scraping API, so you're testing against what a real browser would see.
  2. Type a CSS selector and tool matches as you type.
  3. Copy the generated extraction code in Python, JavaScript, or as a ready-to-run Geekflare API call.

Example Selectors

  • h1 — every top-level heading
  • .price — every element with the class price
  • a[href] — every link with an href attribute
  • article p — every paragraph inside an <article>
  • li:first-child — the first item in every list

A Note on XPath

This tool currently supports CSS selectors only. CSS selectors cover the large majority of real-world scraping needs. XPath support will be added in a future update.

Free to start · No credit card required

Need this at scale? Try the Web Scraping API.

Extract by CSS or XPath selector directly via API. Pass a selector schema and get matching elements back as JSON.

bash
curl -X POST https://api.geekflare.com/webscraping \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":["json"],"extractionMode":"cssSchema","extractionSchema":{"name":"Extracted","baseSelector":"h1","fields":[{"name":"text","selector":"h1","type":"text"}]}}'