web-scraping

Extract public web content using cascading scrapers with trust-boundary validation and poison-pill detection.

1|Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Deepak-ai-93/deepak-skill --skill web-scraping-deepak-ai-93
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-scraping
Source: https://github.com/Deepak-ai-93/deepak-skill/tree/main/skills/web-scraping
Command: npx skills add https://github.com/Deepak-ai-93/deepak-skill --skill web-scraping-deepak-ai-93

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, beautifulsoup4, trafilatura, playwright, yt-dlp, instaloader, and includes scripts (resource) components.

What problem does it solve? Extracting content from websites fails unpredictably due to paywalls, CAPTCHAs, rate limits, and JavaScript-rendered pages, while naive scrapers risk SSRF attacks, prompt injection from untrusted content, and legal exposure from bypassing access controls. ## Core Features & Use Cases - Scraping cascade with fallback: Automatically tries Trafilatura, then Requests + BeautifulSoup, then Playwright (sync and async for Jupyter) until content extraction succeeds. - Trust-boundary controls: Validates every URL and redirect hop against private-network destinations, delimits retrieved content as untrusted EXTERNAL_DATA, and blocks credential leakage. - Poison-pill detection: Identifies paywalls, CAPTCHAs, rate limits, Cloudflare checks, and login walls, then stops rather than escalating evasion. - Social media archiving: Extracts YouTube metadata and transcripts via yt-dlp, Instagram posts via instaloader, and TikTok profiles, plus observed-API analysis from browser dev tools. - Use Case: A researcher needs article text from 50 public URLs. The cascade fetches each with polite per-domain delays, detects a paywall on three, and returns delimited, provenance-tagged content for the rest. ## Quick Start Scrape the public page at this URL using the web-scraping cascade and return the extracted content wrapped in EXTERNAL_DATA tags with its source.

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 requires JavaScript rendering?

Use Playwright to render JavaScript-heavy pages in a headless Chromium browser after lighter methods fail. The cascade tries Trafilatura and Requests first, falling back to Playwright only when extracted content is under 100 characters.

What Python libraries work best for web content extraction?

Trafilatura is fastest for standard articles, Requests with BeautifulSoup handles general HTML parsing, and Playwright renders JavaScript pages. For social media, yt-dlp covers YouTube and TikTok while instaloader handles Instagram.

How do I handle 403, 429, and CAPTCHA errors when scraping?

Treat 401, 403, and 429 responses as stop signals, not escalation triggers. Back off with exponential delays, honor robots.txt and Retry-After headers, and prefer official APIs or documented authorization instead of bypassing controls.

Can I use Playwright inside a Jupyter notebook?

Standard sync Playwright fails in Jupyter because notebooks run their own event loop. Use the async Playwright API with async_playwright and await in notebook cells instead.

How do I prevent SSRF attacks in a web scraper?

Validate every URL and redirect target by resolving the hostname and rejecting non-global IP addresses, loopback, and link-local destinations. Re-validate after each redirect hop and block private-network egress in browser contexts.

Is it legal to scrape public websites?

Scraping public, non-credentialed pages generally does not violate the CFAA after hiQ v. LinkedIn, but ToS breaches carry civil risk and GDPR applies to personal data. Honor robots.txt, rate limits, and cease-and-desist notices.