AI Search now supports CSS content selectors for precise content extraction
AI Search now supports CSS content selectors paired with URL glob patterns to extract only relevant page content during web crawling, ignoring navigation and boilerplate elements. Configure up to 10 content selector entries per instance via dashboard or API.
AI Search now supports CSS content selectors for website data sources. You can now define which parts of a crawled page are extracted and indexed by specifying CSS selectors paired with URL glob patterns.
Content selectors solve the problem of indexing only relevant content while ignoring navigation, sidebars, footers, and other boilerplate. When a page URL matches a glob pattern, only elements matching the corresponding CSS selector are extracted and converted to Markdown for indexing.
Configure content selectors via the dashboard or API:
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/ai-search/instances" \
-H "Authorization: Bearer {api_token}" \
-H "Content-Type: application/json" \
-d '{
"id": "my-ai-search",
"source": "https://example.com",
"type": "web-crawler",
"source_params": {
"web_crawler": {
"parse_options": {
"content_selector": [
{
"path": "**/blog/**",
"selector": "article .post-body"
}
]
}
}
}
}'
Selectors are evaluated in order, and the first matching pattern wins. You can define up to 10 content selector entries per instance.
For configuration details and examples, refer to the content selectors documentation.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.