CSS Selector Extractor for JavaScript Sites (Browser) avatar

CSS Selector Extractor for JavaScript Sites (Browser)

Pricing

from $1.80 / 1,000 pages

Go to Apify Store
CSS Selector Extractor for JavaScript Sites (Browser)

CSS Selector Extractor for JavaScript Sites (Browser)

Extract any CSS selector from JavaScript pages: a real Chromium browser renders each page, waits, scrolls or clicks "load more", then returns text, HTML, attributes, tables or counts. Pay only for pages that load and match; failed or empty pages are free.

Pricing

from $1.80 / 1,000 pages

Rating

0.0

(0)

Developer

Murat Uzun

Murat Uzun

Maintained by Community

Actor stats

0

Bookmarked

7

Total users

1

Monthly active users

13 hours ago

Last modified

Features

Limited permissions

Share

Extract any CSS selector from pages that need JavaScript. A real Chromium browser (Crawlee PlaywrightCrawler) opens each page, waits for the content, can click "load more" and scroll infinite lists, then runs your selectors on the rendered HTML. You get text, HTML, attributes, tables or counts, one dataset row per page. No login.

Pay per use: $0.005 per run start (browser launch, default 1 GB memory) plus $0.003 per page on the free plan ($3.00 per 1,000 pages), lower on higher Apify plans. You pay only for pages that load and match. A blocked or failed page, a page where none of your selectors matched, and (with requiredFields) a page missing a field you need are saved as free DIAGNOSTIC-* records, not charged rows.

When to use this Actor, and when not to

Use this one (browser) whenUse the sibling CSS Selector Extractor (HTTP only) when
The data appears only after JavaScript runs (SPA, React/Vue pages, client-side lists)The HTML already contains the data (view-source shows it)
You need "wait for element", "click load more" or infinite scrollYou only need the page as served
The page is empty or shows "Enable JavaScript" to a plain fetchSpeed and cost matter most

The browser is slower and uses more memory (1024 MB default), so the sibling is cheaper and faster on static sites. (Run durations were not recorded for these cloud tests, so no speed figure is quoted here.) Use the same JSON input in both: the field names and the output rows are the same.

Quick start

Default input loads https://quotes.toscrape.com/js/ and returns the quote text and author of each quote as items:

{
"urls": ["https://quotes.toscrape.com/js/"],
"itemSelector": ".quote",
"selectors": [
{ "name": "text", "selector": ".text", "type": "text" },
{ "name": "author", "selector": ".author", "type": "text" }
]
}

Examples

Follow pagination (3 pages): add linkSelector and maxPages. Each followed page is one result and billed as one page.

{
"urls": ["https://quotes.toscrape.com/js/"],
"itemSelector": ".quote",
"selectors": [{ "name": "text", "selector": ".text", "type": "text" }],
"linkSelector": "li.next a",
"maxPages": 3
}

Infinite scroll: scrollToBottom scrolls until the page stops growing, up to maxScrolls.

{
"urls": ["https://quotes.toscrape.com/scroll"],
"itemSelector": ".quote",
"selectors": [{ "name": "text", "selector": ".text", "type": "text" }],
"scrollToBottom": true,
"maxScrolls": 5
}

"Load more" button: clickSelector clicks the element again and again until it is gone or hidden, up to maxClicks.

{
"urls": ["https://example.com/listing"],
"selectors": [{ "name": "items", "selector": ".product", "type": "count" }],
"clickSelector": "button.load-more",
"maxClicks": 10
}

Wait for content: waitForSelector waits up to waitTimeoutSecs for the element before reading the page. If it never appears, the page is still read and the row's renderNotes says so.

Pay only for complete pages (requiredFields)

Listing and product pages often load without the one field you need (sold-out items without a price, a page variant with a different layout). List those fields in requiredFields and such pages are not charged:

{
"urls": ["https://quotes.toscrape.com/js/", "https://quotes.toscrape.com/js/page/99/"],
"itemSelector": ".quote",
"selectors": [
{ "name": "text", "selector": ".text", "type": "text" },
{ "name": "author", "selector": ".author", "type": "text" }
],
"requiredFields": ["author"]
}

Page 1 returns 10 quotes and is one charged page. Page 99 renders but has no quotes, so it is a free diagnostic record with reason NO_EXTRACTED_DATA. What goes where:

Page outcomeWhere it goesCharged
Loaded, at least one selector matched (and every requiredFields value present)dataset rowyes, one page
Loaded, a requiredFields value missing (in item mode: on any item)DIAGNOSTIC-*, reason REQUIRED_FIELD_MISSINGno
Loaded, no selector matchedDIAGNOSTIC-*, reason NO_EXTRACTED_DATAno
HTTP 404/410DIAGNOSTIC-*, reason PAGE_NOT_FOUNDno
Domain does not existDIAGNOSTIC-*, reason DOMAIN_NOT_FOUNDno
Blocked (403/429/503, challenge page), timeout, other HTTP errorDIAGNOSTIC-*, reason REQUEST_OR_PARSE_FAILEDno

A requested count of 0 is a value, so the page is accepted. The OUTPUT record (Output tab → Quality report) has status (complete, partial, no_results), resultRows, diagnosticRows, diagnosticReasons and firstDiagnosticKey. When no page is accepted, zeroResultReason says why: NO_MATCHES, PAGE_NOT_FOUND and DOMAIN_NOT_FOUND end SUCCEEDED; if every page failed at the source (SOURCE_FAILED) the run ends FAILED, so a broken site is never a silent empty success.

Browser options

FieldDefaultWhat it does
waitForSelectornoneElement that must appear before the page is read
waitTimeoutSecs15How long to wait for it (1 to 60)
waitUntilloaddomcontentloaded (fastest), load, or networkidle (slowest)
scrollToBottomfalseScroll repeatedly for infinite lists
maxScrolls10Scroll steps per page (1 to 100)
clickSelectornoneButton or link to click for "load more"
maxClicks5Clicks per page (1 to 50)
blockResourcestrueBlocks images, fonts and media while rendering (cheaper, faster)

Order of steps on each page: wait for waitForSelector, then clickSelector clicks, then scrollToBottom, then the selectors run on the final HTML.

The shared options

urls, selectors (up to 25; text, html, attr, count, table), firstMatchOnly, maxMatchesPerSelector, trimWhitespace, itemSelector and maxItemsPerPage, linkSelector, sameDomainOnly, urlPattern, urlTemplate with pageRange, sitemapUrls, maxPages, includeMetadata, headers, cookies, proxyMode, proxyConfiguration, inputDatasetId and inputField. They work the same as in the sibling Actor.

Differences from the sibling:

  • maxConcurrency defaults to 3 and is capped at 10 (each page is a browser tab).
  • proxyMode: always routes every page through Apify Proxy. auto and never load pages directly. A blocked page (HTTP 403, 429, 503 or a short challenge page) is a free diagnostic record. This Actor does not switch to the proxy on its own for a blocked page; set proxyMode to always for those sites.

Output

One row per accepted page:

{
"url": "https://quotes.toscrape.com/js/",
"finalUrl": "https://quotes.toscrape.com/js/",
"statusCode": 200,
"contentType": "text/html; charset=utf-8",
"fields": null,
"matchCounts": null,
"htmlSizeBytes": 8985,
"usedProxy": false,
"scrapedAt": "2026-10-11T17:02:57.954Z",
"error": null,
"items": [{ "text": "...", "author": "Albert Einstein" }],
"itemCount": 10
}

fields and matchCounts appear in page mode (no itemSelector); items and itemCount in item mode. renderNotes appears only when a browser step did not finish as asked. foundOn appears on pages reached by following links. A row over 9 MB is not saved as a result; it becomes a free diagnostic record (reason RESULT_TOO_LARGE).

Using the API, Python and n8n

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('webdatatools/css-selector-extractor-js').call({ urls: ['https://quotes.toscrape.com/js/'], itemSelector: '.quote', selectors: [{ name: 'text', selector: '.text', type: 'text' }] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
from apify_client import ApifyClient
client = ApifyClient(token)
run = client.actor("webdatatools/css-selector-extractor-js").call(run_input={"urls": ["https://quotes.toscrape.com/js/"], "itemSelector": ".quote", "selectors": [{"name": "text", "selector": ".text", "type": "text"}]})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())

In n8n, use the Apify node with this Actor's ID and the same JSON input.

Cost

Each run pays $0.005 once at start (one event per GB of memory; the default 1 GB is one event), then $0.003 per page on the free plan; higher plans pay less per page. 100 pages on the free plan: $0.005 + $0.30. Only accepted pages are billed: if 20 of those 100 pages are blocked, return 404 or match none of your selectors, you pay $0.005 + $0.24. Set Maximum cost per run to cap spending. The Actor stops at what the budget covers and says so in the status message.

Watch a section for changes

Need to know when the section you extract here changes? Page & Price Watch 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.

Feedback

Found a bug or a page that does not render? Leave a review at https://apify.com/webdatatools/css-selector-extractor-js/reviews and include the input (without any cookies or headers) and the URL that failed.

Input parameters

FieldTypeDefaultDescription
urlsarray["https://quotes.toscrape.com/js/"]Enter one URL per row. Each page is opened in a real Chromium browser, JavaScript runs, and the selectors are read from the rendered HTML. Each page that loads and matches is one charged row; failed or empty pages are free diagnostics
selectorsarray[{"name":"text","selector":".text","typeEnter the fields to extract as a JSON array of {"name", "selector", "type"} objects, read from the rendered page. "type" is text, html, attr, count or table; "a
requiredFieldsarray[]Optional selector names that must have a value, e.g. ["price"]. A page missing one is a free diagnostic record (REQUIRED_FIELD_MISSING), not a charged row
firstMatchOnlybooleantrueKeep 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.
maxMatchesPerSelectorinteger20Enter 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 retur
trimWhitespacebooleantrueKeep 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 fou
maxConcurrencyinteger3Enter how many pages to render in parallel (each one is a browser tab). Default 3 fits the default 1024 MB memory; raise it only with more memory. Capped at 10.
waitForSelectorstringOptional. A CSS selector that must appear before the page is read, e.g. ".quote". If it does not appear within the wait timeout the page is read anyway and the
waitTimeoutSecsinteger15How long to wait for the "Wait for selector" element, e.g. 15.
waitUntilstring"load"When navigation counts as loaded. 'domcontentloaded' is fastest; 'load' (default) waits for images and scripts; 'networkidle' waits until the network is quiet (
scrollToBottombooleanfalseScroll to the bottom of the page repeatedly so infinite-scroll content loads. Stops when the page stops growing or after Max scrolls.
maxScrollsinteger10Most scroll steps per page when "Scroll to bottom" is on, e.g. 10.
clickSelectorstringOptional. A button or link to click repeatedly to load more content, e.g. "button.load-more". Clicking stops when the element is gone or hidden.
maxClicksinteger5Most clicks per page for "Click selector", e.g. 5.
blockResourcesbooleantrueBlocks images, fonts and video while rendering: faster and cheaper (less traffic). Turn it off only if the data you need is loaded by those resources.
itemSelectorstringOptional. A CSS selector for repeated items, e.g. ".quote" or "div.product-card". When set, each matching element becomes one object in the row's "items" array,
maxItemsPerPageintegerOptional. Most items to return per page in item mode (default 200). "itemCount" always reports the full number.
linkSelectorstringOptional. 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 a
sitemapUrlsarrayOptional. 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, capp
urlPatternstringOptional regular expression. Only followed links and sitemap URLs matching it are processed, e.g. "/products/".
urlTemplatestringOptional. 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 r
pageRangeobjectUsed 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.
maxPagesintegerOptional. Total page cap when following links or reading sitemaps (default 100). Plain URL lists are not capped by this.
sameDomainOnlybooleanOnly follow links on the same host as the page they were found on (default on).
includeMetadatabooleanAdd a "metadata" object to each row: title, description, canonical URL, language, Open Graph tags and parsed JSON-LD (schema.org) blocks.
headersobjectOptional. Extra HTTP headers sent with every page request, e.g. {"Accept-Language": "de-DE", "Authorization": "Bearer …"}. A "User-Agent" here replaces the defa
cookiesarrayOptional. Cookies sent with every page request, as ["name=value", …] or the [{"name": …, "value": …}] list a browser cookie-export extension produces (domain an
proxyModestring"auto"'auto' (default) and 'never' load every page directly; a blocked page is a free diagnostic record, not retried through the proxy. 'always' routes every page thr
proxyConfigurationobject{"useApifyProxy":true,"apifyProxyGroups"Which Apify Proxy group to use when 'Proxy mode' is 'always'. Leave Residential selected (the default). Not needed when running locally with your own IP.
inputDatasetIdstringTake the items from another Actor run's dataset, e.g. "aBcD1234". Combined with the list above.
inputFieldstringColumn holding the value, e.g. "url" (the default). Array columns are flattened.

Errors and diagnostic reasons

Rejected pages are not charged. Each one is a DIAGNOSTIC-* record in the run's key-value store with the page's url, statusCode, error and one of these reasons; OUTPUT.diagnosticReasons counts them.

CodeMeaningWhat to do
NO_EXTRACTED_DATAThe page rendered, but none of your selectors matchedCheck the selector in DevTools on the rendered page; try waitForSelector or waitUntil: "networkidle"
REQUIRED_FIELD_MISSINGA field listed in requiredFields was empty (in item mode: on at least one item)Expected for incomplete pages; drop the field from requiredFields to keep them
PAGE_NOT_FOUNDHTTP 404 or 410Check the URL
DOMAIN_NOT_FOUNDThe domain does not resolveCheck the URL for typos
REQUEST_OR_PARSE_FAILEDBlocked (403/429/503 or a challenge page), timeout, other HTTP error, or a page too large to parseSet proxyMode to always for blocked sites
RESULT_TOO_LARGEThe row was over the 9 MB dataset item limitUse text instead of html, or fewer matches
INPUT_ERRORNo usable URL or selector, or an unknown name in requiredFields (in ERRORS, run SUCCEEDED, nothing fetched)Fix the input
SOURCE_FAILEDEvery page failed at the source and nothing was delivered; the run ends FAILEDTry proxyMode: "always" or check the site

Limitations

  • Runs a real Chromium browser, so each page costs more time and memory than the HTTP sibling. Use the HTTP Actor when the data is in the initial HTML.
  • No login support: pages behind a sign-in wall return whatever the public page shows.
  • Blocked pages (HTTP 403, 429, 503 or a challenge page) become free diagnostic records. The Actor does not switch to another proxy automatically.
  • Selectors are evaluated on the rendered HTML at the time of capture; content that loads later than waitTimeoutSecs is missed.

Run from Python, JavaScript and the CLI

Python (apify-client):

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("webdatatools/css-selector-extractor-js").call(
run_input={"urls": ["https://quotes.toscrape.com/"], "selectors": [{"name": "text", "selector": ".text"}]}
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["url"], row["statusCode"], row["fields"])

JavaScript (apify-client):

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('webdatatools/css-selector-extractor-js').call({
urls: ['https://quotes.toscrape.com/'],
selectors: [{ name: 'text', selector: '.text' }],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].fields);

Apify CLI:

$apify call webdatatools/css-selector-extractor-js --input='{"urls":["https://quotes.toscrape.com/"],"selectors":[{"name":"text","selector":".text"}]}'

MCP (AI agents): add the Apify MCP server (https://mcp.apify.com?actors=webdatatools/css-selector-extractor-js) to Claude, Cursor or any MCP client, and the agent can call this Actor with the same JSON input as above.

CSS Selector Extractor for JavaScript Sites vs. alternatives

Store pages read on 25 Nov 2026 (https://apify.com/<id>). Prices are as listed on each Store page.

ActorPrice on Store pageNotes from its Store page
leadsbrary/selector-map-web-scraperfrom $1.00 per 1,000 resultsNo-code CSS/XPath field map with pagination and detail pages
fieldfeed/structured-data-extractorfrom $2.00 per 1,000 resultsStructured data extraction, one result per row
muhammadafzal/ai-web-extractorfrom $16.00 per 1,000 page processedPlain-English field extraction with AI

This Actor lists $1.80 (top tier) to $3.00 (free tier) per 1,000 pages, charged only for pages that load and match (failed or empty pages are free diagnostics). Its distinct part is the real-browser render, click and scroll step before selector extraction. The no-code and AI alternatives work from a different input model, so only the listed price per unit is compared here.

Support

Report a page that does not render or a selector that returns nothing in the Issues tab of this Actor's Store page. Apify platform questions go to https://docs.apify.com.

Did this Actor save you time? A short review on the Reviews tab helps others find it.