css_selector_extractor
Extract CSS selector data from any page without a browser, returning text, HTML, attributes, or match counts—one row per URL for scraping and site checks.
Instructions
Web Scraper pulls any CSS selector off any page, returning text, HTML, attributes or match counts — one row per URL, no browser required. Billed to your own Apify account: ~$0.002 per Page (Apify free-plan price, lower on paid plans).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | URLs — Enter one URL per row to fetch and run the selectors against, e.g. https://example.com. Each URL gets exactly one result row, even if the fetch fails. Example: ["https://example.com"]. | |
| selectors | Yes | Selectors — Enter the fields to extract as a JSON array of {"name", "selector", "type"} objects. "type" is one of text, html, attr or count; an "attr" entry also needs "attribute" (e.g. {"name":"canonicalUrl","selector":"link[rel='canonical']","type":"attr","attribute":"href"}). Capped at 25 entries per run. Example: [{"name":"title","selector":"h1","type":"text"}]. | |
| firstMatchOnly | No | First match only — 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. | |
| trimWhitespace | No | Trim whitespace — 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. | |
| maxMatchesPerSelector | No | Max matches per selector — 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. |