Prompt

How do I collect training data for machine learning from websites?

Technology / Data Infrastructure2 observationsLast seen Oct 2, 2026

Latest observation

Oct 2, 2026OpenAI APIWeb search: off

Collecting training data from websites usually means one of these approaches:

  1. Use a public API
    Best option if available. It’s cleaner, more stable, and often legally safer than scraping.

  2. Web scraping

    • Use tools like requests, BeautifulSoup, Scrapy, or browser automation like Playwright/Selenium.
    • Parse page HTML, extract the text/images/tables you need, and store them in a structured format like CSV, JSON, or Parquet.
  3. Download existing datasets

    • Sometimes the same content is already available via Kaggle, Hugging Face Datasets, Common Crawl, or academic datasets.
    • This is often easier than collecting it yourself.

Basic workflow

  1. Define your task

    • What are you predicting?
    • What labels do you need?
    • What kind of examples count as positive/negative?
  2. Find sources

    • Websites with relevant content
    • APIs
    • Public archives
  3. Check permissions

    • Read the site’s Terms of Service
    • Check robots.txt
    • Look for copyright/licensing terms
    • Make sure your use is allowed, especially for commercial use or redistribution
  4. Collect the data

    • Crawl or scrape pages
    • Capture the relevant content and metadata
    • Rate-limit requests and avoid overloading servers
  5. Clean and label

    • Remove duplicates, boilerplate, ads, and navigation text
    • Normalize formats
    • Create labels manually or semi-automatically
  6. Store it properly

    • Save raw data separately from cleaned data
    • Keep source URLs, timestamps, and license info for traceability

Important legal and ethical points

  • Respect site policies and copyright.
  • Don’t bypass access controls, paywalls, logins, CAPTCHAs, or anti-bot systems.
  • Be polite to servers: use delays, caching, and small request volumes.
  • Be careful with personal data: privacy laws may apply depending on your jurisdiction and the data type.

Example tools

  • Static pages: requests + BeautifulSoup
  • Large-scale crawling: Scrapy
  • JavaScript-heavy sites: Playwright
  • Table extraction: pandas.read_html
  • APIs: requests, official SDKs

Tiny Python example

import requests
from bs4 import BeautifulSoup

url = "https://example.com"
html = requests.get(url, timeout=10).text
soup = BeautifulSoup(html, "html.parser")

texts = [p.get_text(strip=True) for p in soup.find_all("p")]
print(texts)

If you want, I can also help you with:

  • building a scraper for a specific website,
  • designing a dataset schema,
  • or setting up a pipeline for cleaning and labeling scraped data.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.