scrape-legally-and-respect-robots-txt
Use when collecting data from websites. Checks robots.txt, terms of service, and applicable law before crawling, and stops when they forbid it.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- scrape-legally-and-respect-robots-txt
- description
- Use when collecting data from websites. Checks robots.txt, terms of service, and applicable law before crawling, and stops when they forbid it.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md363 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Scrape Legally and Respect robots.txt
The technical ability to fetch a page is not permission to fetch it. Read the rules first; a crawl that violates them is a liability regardless of how clean the code is.
Procedure
- Read
robots.txtbefore the first request:curl -s https://example.com/robots.txt. HonourDisallowfor your user-agent and checkCrawl-delay. Do not fetch a path a rule excludes. - Identify yourself honestly. Set a descriptive UA with a contact:
curl -A "research-bot/1.0 (+mailto:you@example.com)" .... Never spoof a browser to slip past a block. - Read the Terms of Service for the specific prohibition. Search the page:
curl -s https://example.com/tos | grep -inE 'scrap|crawl|robot|automated|bulk'. "No automated access" means stop. - Check the legal frame that applies: unauthorised access can implicate the CFAA (US) and ToS breach can be a contract claim; personal data triggers GDPR/CCPA obligations. When in doubt, use an official API or a licensed dataset instead.
- Do not defeat controls. Bypassing a login wall, CAPTCHA, or IP block is the line between scraping and unauthorised access.
- Prefer the API, the bulk export, or the public dataset dump (
data.gov, Common Crawl) over crawling an HTML site. - Log the robots.txt decision and its timestamp in your notes so the choice is auditable.
curl -s https://example.com/robots.txt | grep -iE 'User-agent|Disallow|Crawl-delay'
# then verify your path is permitted before building the crawler
Pitfalls
- robots.txt is per-user-agent and per-path; a global
Disallow: /is not overridden by a friendlier section for another bot. - A
403is an answer, not a barrier to route around with a proxy; stop and report it. - Public availability is not the same as a redistribution licence — the licence lives in the ToS or a header.
- Scraping personal data (names, emails, profiles) has stricter rules than scraping product prices.
- Rate is part of compliance: hammering an allowed path can still breach a
Crawl-delay. - A site can change its robots.txt between your crawl planning and your run; re-fetch it at crawl start, not from a cached copy.
Verification
curl -s https://example.com/robots.txt; echo "decision logged: allowed=/path per $(date -u)"
Report: "robots.txt permits /path for this UA; ToS has no anti-scraping clause; using official API for the rate-limited endpoint."
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.