extract_by_selector
Extract specific data from any web page using CSS selectors. Returns text content or attribute values like href for matching elements.
Instructions
Extract specific data from a page using a CSS selector. Returns each matching element's text, or an attribute value when attribute is given (e.g. selector='a.product', attribute='href').
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>",
"selector": "<selector>"
},
"name": "extract_by_selector"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Page URL (http/https). Scheme-less input like `example.com` is allowed. | |
| selector | Yes | CSS selector, e.g. 'h2', '.price', 'table tr td', 'a.result-link'. | |
| attribute | No | Return this attribute instead of text (e.g. 'href', 'src', 'data-id'). | |
| limit | No | Maximum number of matches to return. | |
| render | No | auto=fast static fetch, fall back to headless browser if the page needs JS; static=never use a browser; browser=always render with Playwright (handles SPAs). | auto |