# Web Scraper — CSS Selector & Data Extractor (`webdatatools/css-selector-extractor`) Actor

Extract CSS selectors as text, HTML, attributes, tables or counts. Only accepted pages enter the results dataset; failed or empty pages are retained as diagnostics.

- **URL**: https://apify.com/webdatatools/css-selector-extractor.md
- **Developed by:** [Murat Uzun](https://apify.com/webdatatools) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 18 total users, 10 monthly users, 84.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is CSS Selector Extractor (any page, any field)?

CSS Selector Extractor (any page, any field) is an Apify Actor that turns a list of **URLs** and a list of **CSS selectors** into structured data — no scraper to write, no browser to configure. Give it a page and tell it "get the text at `.price`" or "get the `href` at `a.download-link`" and it returns **one clean row per accepted page** with exactly the values those selectors matched (on a list page, that row carries an `items` array with one object per product, post or listing). It is the generic "scrape this bit of this page" tool people reach for before writing a custom Cheerio or Playwright script, and it works on any static HTML page — product pages, blog posts, directories, documentation, internal tools — using plain HTTP requests, not a headless browser. Runs on Apify's schedule, webhook and API infrastructure, so checking the same selectors across a list of pages on a timer is a five-minute setup.

**New in 0.2:** scrape **list pages** (one object per product card, job row or search result with `itemSelector`), **follow pagination or detail links** (`linkSelector` + `maxPages`), **read whole sites from their sitemap** (`sitemapUrls`, gzip and nested indexes handled) and get **page metadata + JSON-LD** (`includeMetadata`) — all still one billed page per row, no browser. Successful output fields remain compatible.

**Result policy in 0.30:** failed requests, wholly empty extractions and pages missing a requested `requiredFields` value are saved as `DIAGNOSTIC-*` records, outside the charged results dataset. A requested `count` of 0 is still a valid result. Runs with only rejected pages end FAILED with diagnostics available. The actor-start fee may still apply.

### Start with one page

Paste this into the Actor's JSON input and set **Maximum cost per run** before starting:

```json
{
    "urls": ["https://example.com/"],
    "selectors": [{ "name": "pageTitle", "selector": "title", "type": "text" }],
    "maxPages": 1,
    "firstMatchOnly": true
}
```

In **Output**, check that `error` is empty, `matchCounts.pageTitle` is positive and `fields.pageTitle` contains the page title. A page with no extracted values needs a selector change and goes to diagnostics; a requested count of 0 remains valid data. Start with a selector that exists in the fetched HTML; use the JavaScript-rendered companion Actor if the data only appears after JavaScript runs.

Use the [website-fields starter and output checklist](https://data.chimeramind.com/start/website-fields/?utm_source=apify\&utm_medium=readme\&utm_campaign=activation_20261028) for a downloadable input and integration template. Once the first page works, replace the URL and selector with your target, test one page again, then increase the batch. For recurring monitoring, schedule that tested input and keep the same field names so downstream tables remain compatible.

### What data does CSS Selector Extractor extract?

For every accepted URL, the Actor runs each configured selector against the page and returns:

| Field                       | Type           | Description                                                                                               |
| --------------------------- | -------------- | --------------------------------------------------------------------------------------------------------- |
| `url`, `finalUrl`           | string         | The input URL and the URL after following redirects                                                       |
| `statusCode`, `contentType` | number, string | HTTP status code and Content-Type header of the fetched page                                              |
| `fields`                    | object         | One key per selector `name` — a string, an array of strings, a number for `count`, or row objects for `table` |
| `matchCounts`               | object         | One key per selector `name` — how many DOM nodes that selector actually matched                           |
| `htmlSizeBytes`             | number         | Size of the fetched HTML in bytes                                                                         |
| `usedProxy`                 | boolean        | Whether this URL needed Apify Proxy to load                                                               |
| `error`                     | string         | Set when the URL could not be fetched or parsed; every other field but `url` and `scrapedAt` stays `null` |
| `scrapedAt`                 | string         | Timestamp of the fetch (ISO 8601 UTC)                                                                     |
| `items`, `itemCount`        | array, number  | Item mode only: one object per element matching `itemSelector`, and how many matched in total             |
| `metadata`                  | object         | With `includeMetadata`: title, description, canonical URL, language, Open Graph tags and parsed JSON-LD   |
| `foundOn`                   | string         | With `linkSelector`: the page whose link led here (`null` for the start URLs)                             |

### How to use CSS Selector Extractor

1. Fill **URLs** with one page per line — product pages, articles, directory listings, anything with static HTML.
2. Fill **Selectors** with a JSON array of `{"name", "selector", "type"}` objects. `type` is one of `text` (element text), `html` (element's outer HTML), `attr` (an attribute value — add `"attribute":"href"` or similar) or `count` (how many nodes matched, no value extraction).
3. Leave **First match only** on to get one value per selector, or turn it off to get every match as an array (capped by **Max matches per selector**).
4. Click **Start** and export the dataset as JSON, CSV, Excel or HTML from the **Output** tab — one row per accepted page, ready to join, chart or feed into another system.

### Example input

```json
{
    "urls": ["https://example.com/"],
    "selectors": [
        { "name": "pageTitle", "selector": "title", "type": "text" }
    ],
    "firstMatchOnly": true,
    "trimWhitespace": true,
    "maxPages": 1
}
```

### Example output

```json
{
    "url": "https://example.com/",
    "finalUrl": "https://example.com/",
    "statusCode": 200,
    "contentType": "text/html; charset=utf-8",
    "fields": {
        "pageTitle": "Example Domain"
    },
    "matchCounts": {
        "pageTitle": 1
    },
    "htmlSizeBytes": 577,
    "usedProxy": false,
    "scrapedAt": "2026-10-28T14:21:40.381Z",
    "error": null
}
```

Successful extraction appends a `warnings` array: `{ "field": "price", "reason": "no_match" }` for an unmatched selector, or `empty_value` for an empty extracted value. The field name follows your selector. Valid values, including text `"0"` and numeric count `0`, produce no warning. Item mode collects unique field/reason pairs across extracted items. Warnings are advisory; existing acceptance rules still apply. Failed requests retain their existing error shape without this optional array.

A URL that fails to load or parse is retained in the default key-value store as a `DIAGNOSTIC-*` record, not a result row. Open **Quality report** in Output for counts and the first diagnostic key, or use **Storage → Key-value store → Diagnostics**. Mixed batches keep successful results; a batch with no accepted results ends FAILED without a result event.

### Scrape list pages, follow pagination and read sitemaps

**List pages (item mode).** Set `itemSelector` to the repeated element; every selector is then searched inside each item, and the row carries an `items` array — up to 1,000 items per page for the price of one page.

```json
{
    "urls": ["https://books.toscrape.com/"],
    "itemSelector": "article.product_pod",
    "selectors": [
        { "name": "title", "selector": "h3 a", "type": "attr", "attribute": "title" },
        { "name": "price", "selector": ".price_color", "type": "text" }
    ],
    "linkSelector": "li.next a",
    "maxPages": 3
}
```

Output: 3 rows (the start page plus two "next" pages), each with `itemCount: 20` and items like `{ "title": "A Light in the Attic", "price": "£51.77" }`. Rows reached by a followed link carry `foundOn`.

**Pagination and detail pages.** `linkSelector` follows any links you point it at — `a.next` for pagination, `a.product-link` for detail pages — staying on the same domain unless `sameDomainOnly` is off, filtered by an optional `urlPattern` regex, and never beyond `maxPages` (default 100).

**Whole sites from a sitemap.** Give `sitemapUrls` (e.g. `https://example.com/sitemap.xml`) instead of, or together with, `urls`. Sitemap indexes, nested sitemaps and `.xml.gz` files are expanded automatically; `urlPattern` keeps only the pages you want (e.g. `/products/`).

**Numbered pages without a next link.** `urlTemplate` with `pageRange` generates the page URLs up front: `"https://books.toscrape.com/catalogue/page-{page}.html"` with `{"from": 1, "to": 2}` fetches pages 1 and 2 (20 prices each in our cloud test). Use `step` for offset-style URLs such as `?start={page}` with `{"from": 0, "to": 100, "step": 20}`. Generated URLs are not capped by `maxPages` (only by the 10,000 limit and your max total charge).

**HTML tables in one field.** A selector with `"type": "table"` returns the matched `<table>` (or the first table inside the matched element) as an array of row objects keyed by its header row — e.g. `{ "name": "customers", "selector": "#customers", "type": "table" }` on the w3schools tables page gave 6 rows like `{ "Company": "Alfreds Futterkiste", "Contact": "Maria Anders", "Country": "Germany" }`. Blank headers become `column_N`, repeated ones get `_2`, and `colspan` cells are repeated so columns stay aligned. Up to 1,000 rows per table.

**Headers and cookies.** `headers` (e.g. `{"Accept-Language": "de-DE"}`) and `cookies` (e.g. `[{"name": "session", "value": "…"}]` or `["theme=dark"]`) go with every page request — for pages behind a login cookie, an API key header or a locale switch. In our cloud test an echo endpoint received `Accept-Language: de-DE`, a custom header and `Cookie: session=abc123; theme=dark`. Header and cookie values are never written to the run log, but they are stored in the run input like any other field.

**Metadata and JSON-LD.** `includeMetadata: true` adds `metadata` with title, description, canonical URL, language, Open Graph tags and every parsed schema.org JSON-LD block — product prices, ratings, article dates and organization details without writing a selector.

### Use it from code, n8n or Make

Call the Actor over the Apify API and use the rows in your own pipeline. Replace `YOUR_APIFY_TOKEN` with your token from the Apify Console.

**cURL** (synchronous: the response is the dataset rows):

```bash
curl -X POST "https://api.apify.com/v2/acts/webdatatools~css-selector-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://books.toscrape.com/"],"selectors":[{"name":"title","selector":"h1","type":"text"}]}'
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("webdatatools/css-selector-extractor").call(run_input={
    "urls": ["https://books.toscrape.com/"],
    "selectors": [{"name": "title", "selector": "h1", "type": "text"}],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["url"], row["fields"])
```

**JavaScript** (`npm install apify-client`):

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('webdatatools/css-selector-extractor').call({
    urls: ['https://books.toscrape.com/'],
    selectors: [{ name: 'title', selector: 'h1', type: 'text' }],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**n8n and Make:** use the HTTP Request module (n8n) or the HTTP "Make a request" module (Make) with the cURL call above as a POST with a JSON body. The response is an array of rows, one per page, ready for the next step.

### At a glance: this Actor and the other scrapers in the Store

| | CSS Selector Extractor | apify/cheerio-scraper | apify/web-scraper | apify/ai-web-scraper |
| --- | --- | --- | --- | --- |
| How you describe the data | JSON list of `{name, selector, type}` | JavaScript `pageFunction` | JavaScript `pageFunction` | Natural-language prompt |
| Price | $0.002 per page (lower on higher plans) | Free, platform usage only | Platform usage (browser) | $0.009 per page |
| Tables into rows | Built in (`type: "table"`) | Write code | Write code | Not compared |

Prices as listed on each Actor's Store page on 11 October 2026.

### Input parameters

| Parameter               | Type         | Default                                            | Description                                                                                                                           |
| ----------------------- | ------------ | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `urls`                  | array        | `["https://example.com"]`                          | One URL per line to fetch and run the selectors against                                                                               |
| `selectors`             | array (JSON) | `[{"name":"title","selector":"h1","type":"text"}]` | `{name, selector, type, attribute?}` objects; `type` is `text`, `html`, `attr`, `count` or `table`; capped at 25 entries              |
| `requiredFields` | array | `[]` | Selector names that must contain values; a missing required value sends the page to diagnostics without a result event |
| `firstMatchOnly`        | boolean      | `true`                                             | Return only the first match per selector; off returns every match as an array                                                         |
| `maxMatchesPerSelector` | integer      | 20                                                 | Most values returned per selector when `firstMatchOnly` is off (1-500)                                                                |
| `trimWhitespace`        | boolean      | `true`                                             | Collapse whitespace runs and trim ends of extracted `text`/`attr` values                                                              |
| `maxConcurrency`        | integer      | 5                                                  | Parallel page fetches (1-20)                                                                                                          |
| `proxyMode`             | string       | `auto`                                             | `auto` tries every URL directly first and only switches to Apify Proxy after a block is detected; `always` and `never` force one path |
| `proxyConfiguration`    | object       | Residential proxy                                  | Which Apify Proxy group `proxyMode` uses when a request needs the proxy                                                               |
| `itemSelector`          | string       | —                                                  | Repeated element for list pages; selectors are searched inside each match and returned as `items`                                     |
| `maxItemsPerPage`       | integer      | 200                                                | Most items returned per page in item mode (1-1000); `itemCount` always reports the full number                                        |
| `linkSelector`          | string       | —                                                  | Links to follow (pagination or detail pages); each followed page is one more row                                                     |
| `sitemapUrls`           | array        | —                                                  | Sitemap or sitemap-index URLs whose pages are added to the run                                                                        |
| `urlPattern`            | string       | —                                                  | Regular expression that followed links and sitemap URLs must match                                                                    |
| `maxPages`              | integer      | 100                                                | Total page cap when following links or reading sitemaps (plain URL lists are not capped by it)                                       |
| `sameDomainOnly`        | boolean      | `true`                                             | Only follow links on the same host as the page they were found on                                                                     |
| `includeMetadata`       | boolean      | `false`                                            | Add title, description, canonical, language, Open Graph and JSON-LD per page                                                          |
| `urlTemplate`           | string       | —                                                  | URL with a `{page}` placeholder; one URL per number in `pageRange` is added (up to 10,000)                                          |
| `pageRange`             | object       | —                                                  | `{"from": 1, "to": 10, "step": 1}` for `urlTemplate`; inclusive, `from` defaults to 1                                              |
| `headers`               | object       | —                                                  | Extra HTTP headers for every page request; a `User-Agent` here replaces the default                                                |
| `cookies`               | array        | —                                                  | `["name=value"]` or `[{"name", "value"}]` (browser cookie export); sent as one `Cookie` header                                     |

### Pricing

CSS Selector Extractor uses pay-per-event pricing: **$0.002 per accepted page** on the free plan, down to $0.0012 per page on higher Apify plans, plus a negligible actor-start fee. Extracting five selectors from 100 URLs costs about twenty cents, when at least one requested value is returned (or a requested count is0), whether one selector matches or five do — the price is per page, not per field, and in item mode a page with 200 products is still one page. Set **Maximum cost per run** and the Actor stops at what the budget covers instead of overspending — including pages found by following links or reading sitemaps.

### CSS Selector Extractor vs. writing your own scraper

A one-off Node or Python script with Cheerio or BeautifulSoup can do the same extraction, but it means writing fetch/retry/timeout logic, a proxy fallback, whitespace cleanup and a dataset writer from scratch for every new site. This Actor already handles retries, direct-first proxy escalation on a block, and a guaranteed one-row-per-page output shape — describe the fields once as a small JSON list and get a typed dataset back, schedulable and API-callable without touching code.

### Using CSS Selector Extractor with AI agents and MCP

CSS Selector Extractor is pay-per-event with limited permissions — the two requirements for an Actor to be callable through the Apify MCP server at `mcp.apify.com`. An agent that needs one specific value off a page (a price, a title, a status, a download link) can call this Actor directly with a `urls` list and a `selectors` array instead of fetching and parsing HTML itself, and gets back a typed row with the value already extracted, trimmed, and counted.

**Short timeouts never lose results.** Every row is saved to the dataset as soon as its page is processed. When the run's `timeout` is close (the last 10 s, or 5 % of a longer run, at most 2 min) the Actor starts no new pages and the run ends **SUCCEEDED** — not TIMED-OUT — with a status message such as `Stopped early before the run timeout: 495 of 2000 page(s) done…`. URLs it never reached get no row (and cost nothing); read the run's `statusMessage` to tell a complete result from a partial one, and re-run the remaining URLs.

**Sizing a run.** Speed depends on the target site: a fast site gives roughly 10–20 pages per second at the default `maxConcurrency` of 5 (495 docs.apify.com pages in about 30 s in our test), a slow or proxied one far less. Give large lists a timeout of several minutes, or raise `maxConcurrency`. `maxTotalChargeUsd` caps the cost — the Actor processes only as many pages as the budget covers and says so in the status message.

### Need bulk volume or a custom scraper?

Need a fixed monthly price, a large recurring run, extra output fields, or a scraper for a site this Actor does not cover? Open an issue on this Actor's **Issues** tab and include: the target site or URL pattern, the expected volume per run and how often you run it, and the output fields you need. We reply there.

### FAQ

**Does this use a headless browser?** No. It fetches HTML with plain HTTP requests and parses it with Cheerio, which is far faster and cheaper than a browser but means it cannot extract content that is only added by client-side JavaScript after the initial page load.

**What happens if my selector matches nothing?** Optional fields can be null in an otherwise useful result. If no requested field has a value, the page goes to diagnostics instead of generating a result event. A requested `count` of 0 is a valid value. Use `requiredFields`, e.g. `["price"]`, when a specific field must be present; in item mode every returned item must satisfy it.

**What does `type: "count"` do?** It returns how many elements the selector matched as a number, ignoring `firstMatchOnly` — useful for "how many products/comments/results are on this page" without extracting any text.

**Why is my `attr` field null even though the element exists?** Either `attribute` was left out of that selector's definition, or the matched element simply doesn't have that attribute set — both return `null` rather than throwing.

**Why did a site return blocked or empty content?** Some sites answer bot traffic with a challenge page even at HTTP 200. With `proxyMode` set to `auto` (the default), the Actor detects that content and retries the rest of the run through Apify Proxy automatically — no proxy spend unless a block is actually detected.

**Is this legal to run?** Extracting publicly visible page content for your own use is common practice, but you are responsible for complying with the target site's Terms of Service and applicable law (e.g. `robots.txt`, copyright, personal-data rules) for your specific use case.

**Can it crawl a whole site?** Yes — give a sitemap in `sitemapUrls`, or a `linkSelector` such as `a[href]` with `maxPages`. For full-text Markdown of every page rather than specific fields, use [Website to Markdown](https://apify.com/webdatatools/website-to-markdown).

**What happens to a page bigger than 10 MB?** It is not read in full or parsed. Its diagnostic record carries `error` with the reason, and `statusCode` still shows what the server answered. Rate-limited (429) and server-error (5xx) answers are retried with exponential backoff, honouring `Retry-After`, and each URL gets at most 45 seconds across all of its attempts.

**What are the limitations?** No JavaScript rendering, up to 25 selectors per run, up to 1,000 rows per `table` field, up to 500 matches returned per selector even when `firstMatchOnly` is off, and up to 1,000 items per page in item mode. A failing URL produces a diagnostic record with the reason in `error`, outside the result dataset.

Need to know when the section you extract here changes? [Page & Price Watch](https://pagewatch.chimeramind.com/?utm_source=apify\&utm_medium=actor-readme\&utm_campaign=crosslink\&utm_content=css-selector-extractor) watches one CSS-selected section of a public page (or its readable text or price) on a schedule and emails you only when that value changes, so rotating banners and timestamps do not trigger alerts.

### Support and feedback

Found a page shape or selector edge case it should handle better? Open an issue on the **Issues** tab.

### Related Actors

Part of the **webdatatools** web-intelligence suite — every Actor is pay-per-event, reads public data
without a login, and returns one clean row per entity:

Browse the whole suite at [webdatatools](https://paulet4a-commits.github.io/webdatatools/), or call ten of
these Actors straight from Claude, Cursor or Cline with the
[webdatatools MCP server](https://github.com/paulet4a-commits/webdatatools-mcp-server).

### Feedback

Did it help? A quick review helps a lot: https://apify.com/webdatatools/css-selector-extractor/reviews

**Website & domain intelligence**

- [Email Extractor — Website Contact & Social Finder](https://apify.com/webdatatools/contact-extractor) — e-mails, phones and social profiles per domain
- [Tech Stack Detector — Wappalyzer & BuiltWith Alternative](https://apify.com/webdatatools/tech-stack-detector) — CMS, e-commerce, analytics, pixels and payments per domain
- [Domain DNS & Email Security Checker](https://apify.com/webdatatools/dns-email-security-checker) — SPF, DKIM, DMARC, MX provider, registrar and domain age
- [Domain Security Audit (TLS, HTTP headers, redirects, robots)](https://apify.com/webdatatools/domain-security-audit) — TLS expiry, security headers, redirect chain, robots and llms.txt
- [Subdomain Finder (Certificate Transparency)](https://apify.com/webdatatools/subdomain-finder) — every subdomain seen in CT logs, with a live DNS check
- [Bulk Core Web Vitals & PageSpeed Audit](https://apify.com/webdatatools/core-web-vitals-audit) — Lighthouse scores, LCP, CLS, INP and top fixes per URL
- [On-Page SEO Audit](https://apify.com/webdatatools/seo-page-audit) — title, meta, headings, links, images and schema issues per page
- [Sitemap URL Extractor & Change Monitor](https://apify.com/webdatatools/sitemap-extractor) — every sitemap URL, or new and removed pages between runs
- [Wayback Machine Snapshot & Page Change Tracker](https://apify.com/webdatatools/wayback-page-diff) — how a page changed over time, or every archived snapshot
- [Bulk Domain WHOIS & RDAP Lookup](https://apify.com/webdatatools/domain-whois-rdap) — registrar, dates, status and nameservers per domain
- [Website Screenshot Generator](https://apify.com/webdatatools/website-screenshot) — full-page or viewport PNG/JPEG screenshots of any URL

**Content for AI, LLMs and RAG**

- [AI Web Search & Read: Google results as clean Markdown](https://apify.com/webdatatools/ai-web-search) — a query turned into clean Markdown from the top search results
- [Website to Markdown — Content Crawler for LLM & RAG](https://apify.com/webdatatools/website-to-markdown) — any site as clean Markdown per page, no browser
- [llms.txt Generator (Website to llms.txt & llms-full.txt)](https://apify.com/webdatatools/llms-txt-generator) — llms.txt and llms-full.txt for any website or docs site
- [PDF to Markdown Converter (Text, Headings, Metadata)](https://apify.com/webdatatools/pdf-to-markdown) — PDF files to clean Markdown with headings, metadata and token counts
- [RAG Text Chunker (Markdown to Chunks, Token Counts)](https://apify.com/webdatatools/rag-text-chunker) — heading-aware RAG chunks with exact GPT token counts from any dataset
- [Article & News Extractor (clean text, author, date, markdown)](https://apify.com/webdatatools/article-extractor) — clean article text, author, date and Markdown per URL
- [Structured Data & JSON-LD Extractor (Schema.org, Open Graph)](https://apify.com/webdatatools/structured-data-extractor) — Schema.org and Open Graph data from any page
- [Google News Scraper (RSS search by keyword, topic, site)](https://apify.com/webdatatools/google-news-scraper) — news results by keyword, topic or site
- [Press Release Monitor: PR Newswire, BusinessWire, GlobeNewswire](https://apify.com/webdatatools/press-release-monitor) — PR Newswire, Business Wire and GlobeNewswire releases

**Search, video and social**

- [YouTube Shorts Scraper](https://apify.com/webdatatools/youtube-shorts-scraper) — Shorts from channels, hashtags and searches with view counts
- [Pinterest Pins Scraper](https://apify.com/webdatatools/pinterest-pins-scraper) — latest pins of public Pinterest profiles and boards
- [YouTube Transcript Scraper](https://apify.com/webdatatools/youtube-transcript-scraper) — captions and subtitles as text + timed segments, per video or channel
- [Google Search Results Scraper — SERP API](https://apify.com/webdatatools/google-search-scraper) — organic SERP results per keyword and country
- [YouTube Comments Scraper — Comments & Replies](https://apify.com/webdatatools/youtube-comments-scraper) — comments and replies with likes, no API key
- [YouTube Channel Latest Videos (RSS, no API key)](https://apify.com/webdatatools/youtube-channel-videos) — the latest 15 videos of any channel from RSS
- [YouTube Channel Scraper (videos, shorts, live)](https://apify.com/webdatatools/youtube-channel-scraper) — a channel's full video, shorts and stream list
- [YouTube Search Results Scraper (videos, channels, no API key)](https://apify.com/webdatatools/youtube-search-scraper) — videos, channels and playlists per query
- [YouTube Video Details Scraper (views, likes, description, tags)](https://apify.com/webdatatools/youtube-video-details) — views, likes, description, tags and chapters per video
- [Apple Podcasts Lookup & Episodes Scraper](https://apify.com/webdatatools/podcast-lookup) — podcast metadata and episodes from iTunes and RSS
- [Bluesky Post, Search & Profile Scraper](https://apify.com/webdatatools/bluesky-scraper) — posts, profiles, followers and threads from the AT Protocol API
- [X Tweet Scraper (Twitter Posts by URL, No Login)](https://apify.com/webdatatools/x-tweet-scraper) — X (Twitter) posts by URL with likes, replies, author, media and MP4 links
- [TikTok Profile Scraper (Followers, Likes, Bio, Video Stats)](https://apify.com/webdatatools/tiktok-profile-scraper) — TikTok profiles with exact follower and like counts, plus video stats
- [Telegram Channel Posts Scraper](https://apify.com/webdatatools/telegram-channel-scraper) — posts, views and media flags from any public channel
- [Substack Publication & Posts Scraper](https://apify.com/webdatatools/substack-scraper) — archive, authors and paywall status per publication
- [Google Play Reviews Scraper](https://apify.com/webdatatools/google-play-reviews-scraper) — reviews, ratings, replies and app versions per app
- [App Store Reviews Scraper](https://apify.com/webdatatools/app-store-reviews-scraper) — iOS reviews and ratings per app and country
- [Trustpilot Reviews Scraper (Ratings, Replies, No Login)](https://apify.com/webdatatools/trustpilot-reviews-scraper) — Trustpilot reviews with stars, full text, verification and company replies
- [Google Trends Scraper](https://apify.com/webdatatools/google-trends-scraper) — interest over time, by region, and related queries per keyword
- [Google Ads Transparency Scraper](https://apify.com/webdatatools/google-ads-transparency-scraper) — ads any advertiser runs on Google, with format and dates
- [Keyword Suggestions Scraper (Google, YouTube, Amazon, Bing)](https://apify.com/webdatatools/keyword-suggestions-scraper) — autocomplete keyword ideas from four search engines
- [Bilibili Scraper (Videos, Search, Popular)](https://apify.com/webdatatools/bilibili-scraper) — Chinese video platform: views, likes, coins, danmaku, uploader
- [Mastodon Scraper (Hashtags, Accounts, Trending)](https://apify.com/webdatatools/mastodon-scraper) — public fediverse posts by hashtag, account or trending
- [Meetup Events Scraper (Search by Keyword & City)](https://apify.com/webdatatools/meetup-events-scraper) — upcoming events with RSVPs, fees, venues and groups
- [Eventbrite Scraper (Events by Keyword & City)](https://apify.com/webdatatools/eventbrite-scraper) — events by keyword and city with venue, dates and organizer

**Leads, jobs and company data**

- [Career Site Jobs API (Greenhouse, Lever, Ashby, Workday +1)](https://apify.com/webdatatools/career-site-jobs-api) — company domains in, their open jobs out, ATS detected automatically
- [Workday Jobs Scraper](https://apify.com/webdatatools/workday-jobs-scraper) — jobs with full descriptions from any Workday career site
- [Google Maps Scraper](https://apify.com/webdatatools/google-maps-scraper) — businesses with phone, website, address, rating and coordinates per search
- [2GIS Places Scraper (Phones, Websites, Ratings, Hours)](https://apify.com/webdatatools/2gis-places-scraper) — 2GIS businesses in Russia, Kazakhstan, UAE and more with phones, website, rating and hours
- [LinkedIn Jobs Scraper](https://apify.com/webdatatools/linkedin-jobs-scraper) — job titles, companies, locations and full descriptions from LinkedIn job search
- [Company 360: full company profile from a domain](https://apify.com/webdatatools/company-360) — one row per domain: contacts, tech, security, hiring and company facts
- [Hiring Signals Scraper (Greenhouse, Lever, Ashby, Workable)](https://apify.com/webdatatools/hiring-signals) — open jobs and hiring velocity from 10 public ATS boards
- [Y Combinator Companies & Founders Scraper](https://apify.com/webdatatools/yc-companies-scraper) — YC startups by batch, industry and hiring status
- [Wikidata Entity & Company Enrichment (facts, IDs, links)](https://apify.com/webdatatools/wikidata-entity-enrichment) — HQ, founders, employees, revenue and social IDs per company
- [Email Validator & Verifier — Bulk Email Check](https://apify.com/webdatatools/email-validator) — syntax, MX, disposable, role and free-provider checks
- [OpenStreetMap POI Extractor (Overpass API: shops, amenities)](https://apify.com/webdatatools/overpass-poi-extractor) — shops and amenities by radius, bbox or area
- [Stock, Crypto & FX Quotes](https://apify.com/webdatatools/market-quotes) — one row per symbol from Yahoo, Binance and ECB rates
- [Yahoo Finance Scraper (Quotes, Fundamentals, Financials, News)](https://apify.com/webdatatools/yahoo-finance-scraper) — Yahoo Finance fundamentals, analyst targets, financial statements, ownership, news and history per ticker
- [DexScreener Scraper (DEX Pairs, Prices, Liquidity, Boosts)](https://apify.com/webdatatools/dexscreener-scraper) — DEX pairs with price, volume, liquidity, FDV and boosted tokens across chains
- [Polymarket Scraper (Prediction Markets, Odds, Volume)](https://apify.com/webdatatools/polymarket-scraper) — Polymarket markets and events with outcome prices, volume and liquidity
- [StockTwits Scraper (Messages, Sentiment, Trending)](https://apify.com/webdatatools/stocktwits-scraper) — StockTwits messages with Bullish/Bearish sentiment and trending symbols
- [Economic Calendar Scraper (Forex Events, Impact, Forecasts)](https://apify.com/webdatatools/economic-calendar-scraper) — This week's macro events with impact, forecast and previous values
- [Crypto Fear & Greed Index](https://apify.com/webdatatools/crypto-fear-greed-index) — Daily Crypto Fear & Greed Index values with full history
- [Remote Jobs Aggregator (RemoteOK, WWR, Hacker News)](https://apify.com/webdatatools/remote-jobs-aggregator) — one clean row per remote job, de-duplicated across feeds
- [Greenhouse Jobs Scraper](https://apify.com/webdatatools/greenhouse-jobs-scraper) — jobs with descriptions from any Greenhouse job board
- [Lever Jobs Scraper](https://apify.com/webdatatools/lever-jobs-scraper) — jobs with descriptions from any Lever careers page
- [Ashby Jobs Scraper](https://apify.com/webdatatools/ashby-jobs-scraper) — jobs, salaries and descriptions from any Ashby job board
- [SmartRecruiters Jobs Scraper](https://apify.com/webdatatools/smartrecruiters-jobs-scraper) — jobs with descriptions from any SmartRecruiters company
- [Seek Jobs Scraper (Australia & New Zealand)](https://apify.com/webdatatools/seek-jobs-scraper) — Seek job ads with salary, work type and location
- [Dice Jobs Scraper](https://apify.com/webdatatools/dice-jobs-scraper) — US tech jobs from Dice with salary and remote flag
- [AutoScout24 Scraper](https://apify.com/webdatatools/autoscout24-scraper) — European car listings with price, mileage and seller
- [Rightmove Scraper](https://apify.com/webdatatools/rightmove-scraper) — UK property for sale or rent with price and agent
- [Wellfound Jobs Scraper (AngelList Startup Jobs)](https://apify.com/webdatatools/wellfound-jobs-scraper) — startup jobs with salary and equity ranges, company size and stage
- [Yandex Maps Scraper (Places, Ratings, Phones)](https://apify.com/webdatatools/yandex-maps-scraper) — businesses in Russia, Türkiye and the CIS with phones, ratings, hours
- [Craigslist Scraper (Listings, Prices, Locations)](https://apify.com/webdatatools/craigslist-scraper) — listings in any area and category with price, date and coordinates
- [JobStreet Scraper (Malaysia, Singapore, PH, ID + JobsDB)](https://apify.com/webdatatools/jobstreet-scraper) — JobStreet and JobsDB jobs in 6 Asian countries with parsed salaries
- [InfoJobs Scraper (Spain Jobs, Salaries, Companies)](https://apify.com/webdatatools/infojobs-scraper) — Spanish jobs with salary range, contract type and full description
- [StepStone Scraper (Germany, Austria, Belgium Jobs)](https://apify.com/webdatatools/stepstone-scraper) — StepStone jobs in Germany, Austria and Belgium by keyword and city
- [Naukri Jobs Scraper (Salary, Skills, Company Rating)](https://apify.com/webdatatools/naukri-jobs-scraper) — Naukri.com jobs in India with salary range, experience, skills and company rating
- [Zillow Scraper (Homes for Sale, Rent & Sold, Zestimates)](https://apify.com/webdatatools/zillow-scraper) — Zillow homes for sale, rent or sold with Zestimates, beds, baths and photos
- [Zillow Home Details Scraper (Description, Photos, History)](https://apify.com/webdatatools/zillow-detail-scraper) — full Zillow property pages: description, photos, HOA, tax rate, agent
- [Redfin Scraper (Homes for Sale, Prices, Details)](https://apify.com/webdatatools/redfin-scraper) — US homes for sale or sold from any Redfin search, with price and details
- [Kleinanzeigen Scraper (Ads, Prices, Locations)](https://apify.com/webdatatools/kleinanzeigen-scraper) — German classifieds with price, VB flag, ZIP, city and seller type

**Developer, app and research data**

- [npm, PyPI & Crates.io Package Health Checker](https://apify.com/webdatatools/package-health-checker) — releases, downloads, deprecation and a health score
- [GitHub Repository Health & Activity Report](https://apify.com/webdatatools/github-repo-health) — stars, commits, contributors and risk flags per repo
- [VS Code Marketplace Extension Scraper (installs, ratings)](https://apify.com/webdatatools/vscode-marketplace-extensions) — installs, ratings and versions per extension
- [Chrome Web Store Extension Scraper (installs, ratings)](https://apify.com/webdatatools/chrome-web-store-extensions) — users, rating, version and developer per extension
- [Google Play Scraper](https://apify.com/webdatatools/google-play-scraper) — apps, ratings, installs, developer contact and reviews
- [App Store (iOS) App Metadata, Ratings & Top Charts Lookup](https://apify.com/webdatatools/app-store-lookup) — ratings, price, version and charts per app
- [CrossRef DOI & Citation Metadata Lookup](https://apify.com/webdatatools/crossref-doi-lookup) — papers, authors, journals and citation counts
- [FDA Recalls & Adverse Events Monitor (openFDA)](https://apify.com/webdatatools/openfda-recall-monitor) — food, drug and device recalls from openFDA
- [iCal / ICS Calendar Feed to Events Extractor](https://apify.com/webdatatools/ical-calendar-extractor) — any public calendar feed as event rows
- [Shopify Store Products Scraper](https://apify.com/webdatatools/shopify-products-scraper) — catalog, prices, variants and stock per store
- [Hacker News Search & Front Page Scraper](https://apify.com/webdatatools/hacker-news-scraper) — stories, comments and points by query or front page
- [GitHub Trending Repositories Scraper](https://apify.com/webdatatools/github-trending-scraper) — trending repos and developers by language and period
- [Stack Overflow & Stack Exchange Q\&A Scraper](https://apify.com/webdatatools/stackexchange-scraper) — questions, answers and scores by query, tag or site
- [Bulk Image Downloader](https://apify.com/webdatatools/bulk-image-downloader) — download image URLs to storage with size, dimensions and a ZIP
- [Google Flights Scraper (Prices, Airlines, Stops)](https://apify.com/webdatatools/google-flights-scraper) — flight prices, airlines, times, stops and CO2 by route and date
- [Google Hotels Scraper (Prices, Ratings, Reviews)](https://apify.com/webdatatools/google-hotels-scraper) — hotel prices per night, stars, rating and reviews by city and dates
- [Booking.com Scraper (Hotel Prices, Ratings, Availability)](https://apify.com/webdatatools/booking-scraper) — Booking.com hotels for any city and dates with prices, scores and deals
- [Airbnb Scraper (Listings, Prices, Ratings, Coordinates)](https://apify.com/webdatatools/airbnb-scraper) — Airbnb stays for any city and dates with prices, ratings and coordinates
- [AliExpress Scraper (Search Products & Prices)](https://apify.com/webdatatools/aliexpress-scraper) — AliExpress search results with USD price, discount and rank
- [Lazada Scraper (Products, Prices, Sold, Ratings)](https://apify.com/webdatatools/lazada-scraper) — Lazada products in 6 countries with price, rating, units sold and seller
- [Trendyol Scraper (Turkey Products, Prices, Ratings)](https://apify.com/webdatatools/trendyol-scraper) — Trendyol products with price, basket discount, rating and promotions

# Actor input Schema

## `urls` (type: `array`):

Enter one URL per row to fetch and run the selectors against, e.g. https://example.com. Each page fetched gets exactly one result row, even if the fetch fails (in item mode the row holds an items array). Rows are saved as pages finish; if the run timeout comes first, the run stops early and still ends SUCCEEDED with every page done so far.

## `selectors` (type: `array`):

Enter the fields to extract as a JSON array of {"name", "selector", "type"} objects. "type" is text, html, attr, count or table; "attr" also needs "attribute" (e.g. {"name":"canonicalUrl","selector":"link\[rel='canonical']","type":"attr","attribute":"href"}). "table" returns the matched <table> as an array of row objects keyed by its header row. Capped at 25 entries per run.

## `firstMatchOnly` (type: `boolean`):

Keep this on to return only the first element each selector matches. Turn it off to return every match (up to Max matches per selector) as an array.

## `maxMatchesPerSelector` (type: `integer`):

Enter the most matches to return for one selector when First match only is off, e.g. 20. Does not limit the reported match count, only how many values are returned.

## `trimWhitespace` (type: `boolean`):

Keep this on to collapse runs of whitespace and trim the ends of extracted text and attribute values. Turning it off returns text and attr values exactly as found in the page.

## `maxConcurrency` (type: `integer`):

Enter how many URLs to fetch in parallel, e.g. 5. Raise it for long URL lists or short run timeouts (a simple site handles roughly 10–20 pages per second at 5); lower it if a target site starts returning errors under load.

## `itemSelector` (type: `string`):

Optional. A CSS selector for repeated items, e.g. "div.product-card". When set, each matching element becomes one object in the row's "items" array, and every selector above is searched only inside that element. The row is still one per page.

## `maxItemsPerPage` (type: `integer`):

Optional. Most items to return per page in item mode (default 200). "itemCount" always reports the full number.

## `linkSelector` (type: `string`):

Optional. A CSS selector for links to follow, e.g. "a.next" for pagination or "a.product-link" for detail pages. Every followed page is extracted the same way and billed as one page. Capped by Max pages.

## `sitemapUrls` (type: `array`):

Optional. Sitemap or sitemap-index URLs, e.g. https://example.com/sitemap.xml. Every page URL listed (gzip and nested indexes handled) is added to the run, capped by Max pages.

## `urlPattern` (type: `string`):

Optional regular expression. Only followed links and sitemap URLs matching it are processed, e.g. "/products/".

## `urlTemplate` (type: `string`):

Optional. A URL with a {page} placeholder, e.g. "https://books.toscrape.com/catalogue/page-{page}.html". One URL per page number in Page range is added to the run (up to 10,000), after the URLs above. Each page is one result.

## `pageRange` (type: `object`):

Used with URL template: {"from": 1, "to": 10} and optionally "step" (e.g. 20 for offset-style URLs like ?start={page}). Inclusive; from defaults to 1.

## `maxPages` (type: `integer`):

Optional. Total page cap when following links or reading sitemaps (default 100). Plain URL lists are not capped by this.

## `sameDomainOnly` (type: `boolean`):

Only follow links on the same host as the page they were found on (default on).

## `includeMetadata` (type: `boolean`):

Add a "metadata" object to each row: title, description, canonical URL, language, Open Graph tags and parsed JSON-LD (schema.org) blocks.

## `headers` (type: `object`):

Optional. Extra HTTP headers sent with every page request, e.g. {"Accept-Language": "de-DE", "Authorization": "Bearer …"}. A "User-Agent" here replaces the default one. Values are never written to the log.

## `cookies` (type: `array`):

Optional. Cookies sent with every page request, as \["name=value", …] or the \[{"name": …, "value": …}] list a browser cookie-export extension produces (domain and path are ignored). Values are never written to the log; a raw Cookie header can also go in Request headers.

## `proxyMode` (type: `string`):

'auto' (recommended) requests each URL directly first and only switches to Apify Proxy for the rest of the run if a direct request gets blocked — this keeps proxy cost at $0 whenever a site isn't blocking datacenter IPs. 'always' skips the direct attempt and always uses the proxy. 'never' always requests directly, even if that means errors.

## `proxyConfiguration` (type: `object`):

Which Apify Proxy group to use when 'Proxy mode' above decides a request needs the proxy (either 'auto' after a block, or 'always'). Leave Residential proxy selected (the default) unless you know a datacenter group works for your target. Not needed when running locally with your own IP.

## `inputDatasetId` (type: `string`):

Take the items from another Actor run's dataset, e.g. "aBcD1234". Combined with the list above.

## `inputField` (type: `string`):

Column holding the value, e.g. "url" (the default). Array columns are flattened.

## `requiredFields` (type: `array`):

Optional names from Selectors. Every listed field must contain a value (a count of 0 is valid). In item mode every returned item must meet this requirement, otherwise the page goes to diagnostics without a result event.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://apify.com"
  ],
  "selectors": [
    {
      "name": "title",
      "selector": "h1",
      "type": "text"
    },
    {
      "name": "canonicalUrl",
      "selector": "link[rel='canonical']",
      "type": "attr",
      "attribute": "href"
    }
  ],
  "firstMatchOnly": true,
  "maxMatchesPerSelector": 20,
  "trimWhitespace": true,
  "maxConcurrency": 5,
  "pageRange": {
    "from": 1,
    "to": 3
  },
  "proxyMode": "auto",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "requiredFields": []
}
```

# Actor output Schema

## `results` (type: `string`):

All extracted fields per URL — download as JSON, CSV, Excel or HTML.

## `qualityReport` (type: `string`):

Accepted/rejected counts and the first diagnostic record key. Rejected rows do not generate a result event; the start fee may still apply.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://example.com",
        "https://apify.com"
    ],
    "selectors": [
        {
            "name": "title",
            "selector": "h1",
            "type": "text"
        },
        {
            "name": "canonicalUrl",
            "selector": "link[rel='canonical']",
            "type": "attr",
            "attribute": "href"
        }
    ],
    "firstMatchOnly": true,
    "maxMatchesPerSelector": 20,
    "trimWhitespace": true,
    "maxConcurrency": 5,
    "pageRange": {
        "from": 1,
        "to": 3
    },
    "proxyMode": "auto",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("webdatatools/css-selector-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "urls": [
        "https://example.com",
        "https://apify.com",
    ],
    "selectors": [
        {
            "name": "title",
            "selector": "h1",
            "type": "text",
        },
        {
            "name": "canonicalUrl",
            "selector": "link[rel='canonical']",
            "type": "attr",
            "attribute": "href",
        },
    ],
    "firstMatchOnly": True,
    "maxMatchesPerSelector": 20,
    "trimWhitespace": True,
    "maxConcurrency": 5,
    "pageRange": {
        "from": 1,
        "to": 3,
    },
    "proxyMode": "auto",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("webdatatools/css-selector-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://example.com",
    "https://apify.com"
  ],
  "selectors": [
    {
      "name": "title",
      "selector": "h1",
      "type": "text"
    },
    {
      "name": "canonicalUrl",
      "selector": "link[rel='\''canonical'\'']",
      "type": "attr",
      "attribute": "href"
    }
  ],
  "firstMatchOnly": true,
  "maxMatchesPerSelector": 20,
  "trimWhitespace": true,
  "maxConcurrency": 5,
  "pageRange": {
    "from": 1,
    "to": 3
  },
  "proxyMode": "auto",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call webdatatools/css-selector-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,webdatatools/css-selector-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/c705gmJYJNPuwewQI/builds/NFuHBEWCTzrTAxBwo/openapi.json
