HTML Attribute Extractor
Extract specified attributes (href, src, data-*, etc.) from HTML content with tag name filtering support
## Features
Extracts and analyzes HTML attributes from any HTML content:
- **Targeted Extraction**: Specify exact attributes to extract (href, src, id, class, etc.)
- **Tag Filtering**: Limit extraction to specific HTML elements (a, img, div, etc.)
- **Data Attributes**: Support for data-* attributes with wildcard matching
- **URL Analysis**: Optional parsing and validation of URL components
- **Statistics**: Comprehensive statistics per attribute (count, unique values, empty count)
- **Position Tracking**: Line numbers and character positions for source references
## Supported Attributes
- Standard HTML attributes: href, src, alt, title, id, class, etc.
- Data attributes: data-*, data-id, data-custom-*, etc.
- Custom attributes: any attribute present in HTML elements
## Use Cases
- Extract all links from HTML pages
- Find all image sources
- Analyze data attributes for analytics tracking
- SEO link auditing and validation
- Asset URL extraction and validation
- HTML structure analysis
API Documentation
Request Endpoint
POST /en/api/tools/html-attribute-extractor
Request Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| htmlContent | textarea | Yes | - |
| attributes | select | No | - |
| tagFilter | select | No | Optional: Only extract from specific HTML elements |
| includeDataAttributes | checkbox | No | Extract data-* attributes when specified or using data-* wildcard |
| extractUrlComponents | checkbox | No | Parse URLs into protocol, domain, and path components |
Response Format
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}
JSON Data:
JSON Data
AI MCP Documentation
Add this tool to your MCP server configuration:
{
"mcpServers": {
"elysiatools-html-attribute-extractor": {
"name": "html-attribute-extractor",
"description": "Extract specified attributes (href, src, data-*, etc.) from HTML content with tag name filtering support",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=html-attribute-extractor",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.
If you encounter any issues, please contact us at [email protected]