# CSS Selector Scraper (JS-Rendered Pages)

> CSS Selector Scraper (JS-Rendered Pages) is a paid API for AI agents from api.agishub.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Extracts text and attributes of elements matching CSS selectors from a JavaScript-rendered web page using a headless browser.

## Facts

- Endpoint: GET https://api.agishub.com/v1/scrape
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/css-selector-scraper-js-rendered-pages-96883bb0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7MlZXTpbEUdHeMW-ynOW9

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability css-selector-scraper-js-rendered-pages-96883bb0
```

Example prompt: Scrape the page at https://example.com/products using a headless browser and extract the text and attributes of all elements matching 'h1', '.price', and 'a.product'.

## When to prefer this

Choose this endpoint when the target page relies on JavaScript to render its content (SPAs, React/Vue/Angular apps) and static HTML scraping would fail. It is ideal when you need to extract specific, named elements by CSS class, tag, or attribute rather than the full page body. Prefer it over full-page scrapers when you only need a targeted subset of DOM elements and want structured per-selector results.

## Known failure modes

- URL unreachable or returns non-200 status — empty results or error response
- No elements match the given selectors — empty match list returned
- Page requires authentication — scraped content may be login wall instead of target content
- Selectors array exceeds maximum of 20 items — request rejected
- Headless browser timeout on very slow or complex pages — partial or no results
- Invalid CSS selector syntax — error or zero matches returned

## How this service works

Extract specific elements from a JavaScript-rendered page by CSS selector. Give a list of selectors (e.g. 'h1', '.price', 'a.product') and get back the text and attributes of every match. Backed by a headless browser, so it works on SPAs and JS-heavy pages.

## Output

A JSON object containing, for each provided CSS selector, a list of matched DOM elements with their inner text content and HTML attributes (e.g. href, src, class). Returns all matches found on the fully JavaScript-rendered page.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "enum": [
      "http"
     ],
     "type": "string"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url",
      "selectors"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "Full http/https URL of the page to scrape."
      },
      "selectors": {
       "type": "array",
       "items": {
        "type": "string",
        "minLength": 1
       },
       "maxItems": 20,
       "minItems": 1,
       "description": "CSS selectors to extract, e.g. ['h1', 'a.product', '.price']. Returns the text and attributes of every match per selector."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "enum": [
      "json"
     ],
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "Extract specific elements from a JavaScript-rendered page by CSS selector. Give a list of selectors (e.g. 'h1', '.price'"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/css-selector-scraper-js-rendered-pages-96883bb0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agishub.com](https://www.zero.xyz/host/api.agishub.com/llms.txt)
