Web scraping

From bighardperson/computer-science-skills-collection · View interactive version

Web scraping is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Extract structured information from websites using web_fetch for simple pages and browser automation for dynamic sites, login-gated flows, pagination, infinite scroll, or pages that require clicking/searching/filtering. Use when the user asks to scrape a site, collect listings, gather fields from ma

How to use this skill

Skill file

Web Scraping

Extract data with the lightest reliable method first.

Choose the approach

  1. Use web_fetch for simple public pages when the needed content is already in HTML.
  2. Use browser when the site is dynamic, needs clicking, infinite scroll, filters, tabs, or login/session state.
  3. Use web_search only to discover candidate pages when the target URL is unknown.

Default workflow

  1. Identify the target site and exact fields to collect.
  2. Test one page first.
  3. Decide the extraction method:
  1. Normalize the output into a stable schema.
  2. If scraping multiple pages, avoid tight loops and serialize requests.
  3. Deduplicate by URL or stable item id.
  4. Save results in the workspace when the task is larger than a quick one-off.

Browser scraping pattern

  1. Open the page.
  2. Take a snapshot.
  3. Interact only as needed: search, click filters, pagination, expand sections.
  4. Re-snapshot after each meaningful state change.
  5. Extract only the fields the user asked for.
  6. Close tabs when finished.

Output guidance

Prefer one of these formats:

Use explicit keys, for example:

[
  {
    "title": "...",
    "url": "...",
    "source": "...",
    "date": "...",
    "summary": "..."
  }
]

Reliability rules

Cleanup

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.