extract_by_selector
Extract text, HTML, or attributes from web pages using CSS selectors. Specify a URL and selector to retrieve matching content.
Instructions
Extract content from a web page using CSS selectors.
Args: url: The URL to fetch css_selector: CSS selector (e.g. 'h1', '.article', '#main p') attribute: What to extract: 'text' (inner text), 'html' (inner HTML), or an attribute name like 'href', 'src', 'alt' timeout: Request timeout in seconds max_results: Maximum results to return (default 50, max 200)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| css_selector | Yes | ||
| attribute | No | text | |
| timeout | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |