Common data sources
For RAG, collect articles and documents in the target domain, then chunk the body text and store it with metadata. For a sentiment model, collect review text and scores as labeled data.
Field and data design
Training data should keep provenance and context, not just body text. Fields to keep for training and RAG:- Body text (cleaned)
- Title, headings, section structure
- Publish and update dates
- Category, tags, language
- Source URL
- Collection timestamp
- License and terms-of-service information (reuse rights)
- Content authority signals (domain, author)
- Hash or normalized text for deduplication
- Collection conditions (query, scope, sampling)
Collection flow
- Choose data sources that fit the target model and task.
- Discover target pages (search, categories, sitemaps, listing pages).
- Extract body text and metadata (drop navigation, ads, and repeated elements).
- Normalize and clean the text (strip HTML, fix whitespace, unify encoding).
- Deduplicate (by URL, normalized text, or hash).
- Filter for quality (drop too-short, wrong-language, or boilerplate content).
- Format for training (JSONL, chunks with metadata, and so on).
Quality and compliance
Data collection for AI and LLMs has to be designed for both quality and licensing.- Copyright and terms of service: whether body text can be reused is separate from whether it can be collected. Check licenses and each site’s terms.
- robots.txt: check crawl permission per target URL.
- Personal data: minimize names, contact details, and other personal data — don’t collect or store it if you don’t need it.
- Provenance records: keep source URL and collection timestamp so you can verify licenses and handle opt-outs later.
- Quality: exclude boilerplate, duplicates, machine-translation noise, and harmful content from training data.
Collecting with Octoparse and MCP
Octoparse renders pages in a headed, real browser, so text generated dynamically with JavaScript can be collected too. Build a workflow that separates discovery (listings, search) from extraction (body text, metadata), and run it on a cloud schedule to keep training data refreshed. To collect data directly from an AI agent, use Octoparse MCP Server: an MCP-capable AI client can search templates, run tasks, and retrieve data in natural language. For general content extraction, the universal content scraper template works across arbitrary web pages.Related resources
- Run data collection from an AI agent (MCP Server) — an MCP-capable client collects Octoparse data directly
- Scraping JavaScript-rendered pages — approaches for dynamic content
- How to handle pagination — cover large numbers of pages
- Refine and clean extracted data — normalize text for training
- Is web scraping legal? — legality and scope of collection