agentleFS
bestdeejay-designbestdeejay-design/agent-skills/skills/web-scraper/SKILL.md

web-scraper

Skill6 starsChanged 3 months agoMITView on GitHub

Вежливый скраппинг HTML-страниц в Markdown/JSON. Скрипт scrape.py читает страницу по URL, применяет простой CSS-селектор (tag, tag#id, tag.class) для выбора строк/секций, извлекает текст, ссылки и таблицы и отдаёт результат в Markdown или JSON. Легальные guardrails встроены в код: проверка robots.txt, честный User-Agent, задержка между запросами (по умолчанию 1.0 с), лимит размера страницы 10 МБ. Триггеры: 'web scraping', 'скраппинг', 'скачать данные с сайта', 'парсинг сайта', 'парсер html', 'извлечь данные', 'scrape', 'scraping'.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use content-topic-generator, image-skill-builder and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zephyrwang6Skill

    content-topic-generator

    从文章、推文、社交媒体内容生成多角度选题,包括推文选题(140字完整内容)和公众号选题(含详细大纲)。支持延伸、反驳、扩充、热点结合四种策略。当用户需要基于现有内容创作新选题、分析文章生成衍生内容、或进行内容再创作时使用。适用场景:(1) 分析推文/文章并生成选题,(2) 创建公众号/社交媒体内容策划,(3) 将长文拆解为多个传播点,(4) 内容营销和话题策划。

    Also in 4 projects that use this

  • zephyrwang6Skill

    image-skill-builder

    帮助用户通过交互式问答创建自定义批量生图 Skill。用户不需要写代码,只需回答问题即可生成完整可用的生图 Skill。当用户说"帮我创建生图Skill"、"我想做一个配图技能"、"创建批量出图的Skill"、"生成图片的Skill怎么做"、"帮我做一个AI画图技能"时触发。支持文章配图、Logo设计、分镜故事、社交媒体图、海报等任意图片场景。

    Also in 3 projects that use this

  • +10 more from zephyrwang6

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 21
  2. Distinctive:

    Do NOT use when:

    line 27
  3. Distinctive:

    Do not use to bypass robots.txt, authentication, rate limits, or access controls.

    line 94

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Scraper

Вежливый скраппинг HTML-страниц в Markdown/JSON на чистом Python 3 stdlib.

Загружай этот скилл когда нужно извлечь данные с веб-страницы: текст, ссылки и таблицы из выбранных секций — для анализа, отчётов или датасетов.

🎯 When to use

Use this skill when:

  • Нужно скачать данные с сайта: текст, ссылки, таблицы из выбранных блоков
  • Просят «скраппинг», «парсинг сайта», «парсер html», «извлечь данные»
  • Нужен быстрый дамп страницы в Markdown или JSON без установки библиотек
  • Нужен вежливый сбор данных с учётом robots.txt и rate limit

Do NOT use when:

  • Нужен полноценный CSS/XPath-парсер с вложенными селекторами — это BeautifulSoup/lxml
  • Нужен обход JS-рендеринга (SPA) — stdlib не исполняет JavaScript
  • Нужен массовый сбор тысяч страниц — согласуй с владельцем сайта и ToS
  • Нужны данные из API — используй прямой HTTP-запрос к API

📦 Files

  • SKILL.md — этот файл
  • scripts/scrape.py — скрапер (Python 3 stdlib: urllib.request, html.parser)

🧰 Usage

# Markdown (по умолчанию), селектор по классу:
python3 skills/web-scraper/scripts/scrape.py --url https://example.com --selector "div.item"

# JSON, селектор по id:
python3 skills/web-scraper/scripts/scrape.py --url https://example.com --selector "div#list" --output json

# Все абзацы страницы:
python3 skills/web-scraper/scripts/scrape.py --url https://example.com --selector "p"

# Локальный файл (без сети, для теста):
python3 skills/web-scraper/scripts/scrape.py --url file:///tmp/test.html --selector "p"

# Увеличить задержку между запросами:
python3 skills/web-scraper/scripts/scrape.py --url https://example.com --selector "article" --delay 2.5

Селектор — простой tag, tag#id или tag.class (например div#list, tr.row). Каждый совпавший элемент становится отдельным пунктом: текст, ссылки и таблицы.

⚖️ Legal guardrails

Скрипт соблюдает правила вежливого скраппинга (встроены в код):

  • robots.txt — перед запросом читается robots.txt с origin-хоста; если путь запрещён правилом Disallow, скрипт пропускает страницу с сообщением и кодом 3.
  • User-Agent — честный идентификатор Mozilla/5.0 (compatible; web-scraper/1.0; +educational).
  • Rate limit — задержка между запросами по умолчанию 1.0 с (--delay).
  • Лимит размера — страницы больше 10 МБ отклоняются.
  • ToS — перед массовым сбором проверь условия использования сайта и авторские права на данные; скрипт предназначен для образовательных целей.

🔬 Проверка результата

  • Markdown: начинается с # <title>, содержит секции ## Элементы (N) с текстом, ссылками и таблицами.
  • JSON: валидный JSON с ключами title, url, matched, items[] (text, href).
  • При ошибке сети/robots скрипт пишет причину в stderr и завершается с кодом 2 (или 3 при запрете robots.txt), без traceback в stdout.

Canonical analogues

Канонические аналоги, недостающие техники (Retry-After, backoff + jitter, crawl-delay, rate-limit заголовки, условные запросы) и CLI-примеры — в references/canonical-patterns.md. Топ:

  • MCP Fetch Server (modelcontextprotocol/servers) — эталон «URL → Markdown»: robots.txt по умолчанию, честный UA, лимит размера.
  • Scrapy — эталон вежливости: RobotsTxtMiddleware, AutoThrottle (адаптивная задержка), ретраи на 408/429/5xx.
  • Crawlee (Apify) — respect_robots_txt_file=True, ретраи с backoff, autoscaling, ротация прокси.
  • Playwright — браузерное извлечение: locator API, text_content(), page.content().
  • Trafilatura — ближайший по назначению аналог: CLI HTML → Markdown/JSON.
  • Mozilla Readability — канонический алгоритм извлечения основного контента статьи.

Boundaries

  • Do not use to bypass robots.txt, authentication, rate limits, or access controls.

Evidence and completion gate

Run the documented command against the user’s actual input. Report the command, exit status, files changed or produced, and relevant stdout/stderr. Separate blocked or pre-existing failures from failures introduced by the current work. Do not call the result complete when the script was only described or when an artifact was not reopened and checked.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.