web-scraping

Extract website content using cascading scrapers with anti-bot bypass and poison pill detection.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/kaitoartz/dotfiles --skill web-scraping-kaitoartz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: web-scraping
Source: https://github.com/kaitoartz/dotfiles/tree/main/dot_agents/skills/web-scraping
Command: npx skills add https://github.com/kaitoartz/dotfiles --skill web-scraping-kaitoartz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, beautifulsoup4, trafilatura, playwright, playwright-stealth, yt-dlp, instaloader, fake-useragent, curl_cffi.

What problem does it solve? Extracting content from websites often fails due to paywalls, CAPTCHAs, JavaScript rendering requirements, and anti-bot defenses like Cloudflare or DataDome, leaving you with empty or truncated data. ## Core Features & Use Cases - Scraping Cascade: Automatically falls back from trafilatura to requests to Playwright with stealth mode until content extraction succeeds. - Poison Pill Detection: Identifies paywalls, CAPTCHAs, rate limits, and login walls via status codes, domain lists, and regex pattern matching. - Social Media & Undocumented APIs: Extracts YouTube and TikTok metadata with yt-dlp, Instagram posts with instaloader, and reverse-engineers hidden JSON APIs from browser dev tools. - Use Case: A journalist needs to archive 200 articles from news sites with mixed paywall and anti-bot protection; the cascade extracts content while the detector flags which URLs hit paywalls or Cloudflare challenges. ## Quick Start Scrape the article at this URL using the scraping cascade and tell me which extraction method succeeded and whether any paywall or anti-bot page was detected.

Frequently Asked Questions about web-scraping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scrape a website that blocks bots with Python?▼

Use a cascading approach: try trafilatura first for plain articles, then requests with rotating user agents, then Playwright with playwright-stealth for JavaScript-heavy protected sites. For TLS fingerprinting defenses, use curl_cffi; for Turnstile challenges, consider SeleniumBase UC Mode or Camoufox.

How to detect paywalls and CAPTCHAs when scraping?▼

Check HTTP status codes first (429 for rate limits, 403 for blocks, 404 for missing pages), then match content against regex patterns like 'subscribe to continue' or 'verify you are human'. Known paywall domains with suspiciously short content under 500 characters are also flagged.

Playwright vs requests for web scraping, which should I use?▼

Use requests or trafilatura for static HTML pages since they are fast and lightweight. Use Playwright with stealth mode only when the site requires JavaScript rendering or employs anti-bot detection, since browser automation is significantly slower and heavier.

Can I use Playwright in a Jupyter notebook?▼

Sync Playwright fails in Jupyter because notebooks run their own event loop. Use the async API with async_playwright and await the fetch calls directly in notebook cells instead.

How do I download YouTube video metadata and transcripts?▼

Use yt-dlp with skip_download enabled to extract title, description, duration, and view counts without downloading the video. For transcripts, enable writesubtitles and writeautomaticsub options to access manual or auto-generated captions.

Is web scraping legal and what are the risks?▼

Scraping public non-credentialed pages is generally not a CFAA violation after hiQ v. LinkedIn, but breaching terms of service creates civil liability. Honor robots.txt, respect rate limits, avoid scraping behind authentication, and stop after a cease-and-desist.