๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
ๅฐ้พ™่™พๅฐ้พ™่™พAI
๐Ÿค–

Scrape

Legal web scraping with robots.txt compliance, rate limiting, and GDPR/CCPA-aware data handling.

ไธ‹่ฝฝ9.0k
ๆ˜Ÿๆ ‡9
็‰ˆๆœฌ1.0.0
ๆต่งˆๅ™จ็ฝ‘้กต
ๅฎ‰ๅ…จ้€š่ฟ‡

ๆŠ€่ƒฝ่ฏดๆ˜Ž


name: Scrape description: Legal web scraping with robots.txt compliance, rate limiting, and GDPR/CCPA-aware data handling.

Pre-Scrape Compliance Checklist

Before writing any scraping code:

  1. robots.txt โ€” Fetch {domain}/robots.txt, check if target path is disallowed. If yes, stop.
  2. Terms of Service โ€” Check /terms, /tos, /legal. Explicit scraping prohibition = need permission.
  3. Data type โ€” Public factual data (prices, listings) is safer. Personal data triggers GDPR/CCPA.
  4. Authentication โ€” Data behind login is off-limits without authorization. Never scrape protected content.
  5. API available? โ€” If site offers an API, use it. Always. Scraping when API exists often violates ToS.

Legal Boundaries

  • Public data, no login โ€” Generally legal (hiQ v. LinkedIn 2022)
  • Bypassing barriers โ€” CFAA violation risk (Van Buren v. US 2021)
  • Ignoring robots.txt โ€” Gray area, often breaches ToS (Meta v. Bright Data 2024)
  • Personal data without consent โ€” GDPR/CCPA violation
  • Republishing copyrighted content โ€” Copyright infringement

Request Discipline

  • Rate limit: Minimum 2-3 seconds between requests. Faster = server strain = legal exposure.
  • User-Agent: Real browser string + contact email: Mozilla/5.0 ... (contact: you@email.com)
  • Respect 429: Exponential backoff. Ignoring 429s shows intent to harm.
  • Session reuse: Keep connections open to reduce server load.

Data Handling

  • Strip PII immediately โ€” Don't collect names, emails, phones unless legally justified.
  • No fingerprinting โ€” Don't combine data to identify individuals indirectly.
  • Minimize storage โ€” Cache only what you need, delete what you don't.
  • Audit trail โ€” Log what, when, where. Evidence of good faith if challenged.

For code patterns and robots.txt parser, see code.md

ๅฆ‚ไฝ•ไฝฟ็”จใ€ŒScrapeใ€๏ผŸ

  1. ๆ‰“ๅผ€ๅฐ้พ™่™พAI๏ผˆWeb ๆˆ– iOS App๏ผ‰
  2. ็‚นๅ‡ปไธŠๆ–นใ€Œ็ซ‹ๅณไฝฟ็”จใ€ๆŒ‰้’ฎ๏ผŒๆˆ–ๅœจๅฏน่ฏๆก†ไธญ่พ“ๅ…ฅไปปๅŠกๆ่ฟฐ
  3. ๅฐ้พ™่™พAI ไผš่‡ชๅŠจๅŒน้…ๅนถ่ฐƒ็”จใ€ŒScrapeใ€ๆŠ€่ƒฝๅฎŒๆˆไปปๅŠก
  4. ็ป“ๆžœๅณๆ—ถๅ‘ˆ็Žฐ๏ผŒๆ”ฏๆŒ็ปง็ปญๅฏน่ฏไผ˜ๅŒ–

็›ธๅ…ณๆŠ€่ƒฝ