Prompt

How do I scrape data from a website without an API?

Technology / Data Infrastructure1 observationLast seen Jul 15, 2026

Latest observation

Jul 15, 2026OpenAI APIWeb search: off

If a website doesn’t offer an API, you can still collect data by scraping the pages directly. The basic idea is:

  1. Inspect the page source

    • Open the site in your browser.
    • Use Developer Tools → Elements to see the HTML structure.
    • Find the tags/classes/IDs that contain the data you want.
  2. Fetch the page

    • Use a tool like:
      • Python: requests, BeautifulSoup, lxml
      • JavaScript/Node.js: axios, cheerio, playwright, puppeteer
    • Example in Python:
      import requests
      from bs4 import BeautifulSoup
      
      url = "https://example.com/page"
      html = requests.get(url).text
      soup = BeautifulSoup(html, "html.parser")
      
      titles = [el.get_text(strip=True) for el in soup.select(".title")]
      print(titles)
      
  3. Handle dynamic content

    • If the data is loaded by JavaScript after the page loads, requests may not see it.
    • In that case, use a browser automation tool like:
      • Playwright
      • Selenium
      • Puppeteer
    • These load the page like a real browser.
  4. Paginate / navigate

    • If data spans multiple pages, loop through the page numbers or “next” links.
    • Add delays between requests to avoid overloading the site.
  5. Store the data

    • Save to CSV, JSON, a database, etc.
  6. Be careful about legality and site rules

    • Check the site’s Terms of Service and robots.txt.
    • Don’t scrape private, protected, or copyrighted data in ways that violate rules.
    • Rate-limit your requests and identify your crawler if appropriate.

When scraping gets tricky

  • Anti-bot measures: CAPTCHAs, rate limits, login walls.
  • Dynamic rendering: content only appears after JS execution.
  • Hidden data: sometimes data is embedded in scripts or JSON blobs in the HTML.

Good practice

  • Respect robots.txt
  • Use reasonable delays
  • Cache results
  • Handle errors and retries
  • Don’t make too many requests too quickly

If you want, I can show you:

  • a simple Python scraper
  • a JavaScript/Node.js scraper
  • or a Playwright example for JavaScript-heavy sites

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation 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.